Refactored everything so the code is not just a single huge function. Added options to control the size of the generated spritesheet, the packing method, the json formatting and whether the sprites can be flipped or not for better packing results.
Added text for --help command.
Updated README to reflect new features.