pack and unpack commands, many more error conditions need to be checked
subcommands are now objects, lots of things removed from the main script as a result