nwztools/upg: move upg handling to its own file, completely rework kas handling

This was a huge mess, the new is much cleaner hopefully.

Change-Id: I43663d021dc8bc31662d3923e1c3da22d987ebf9
6 files changed