Refactor to allow for different package types and add support to exposing themes.
Remove unneeded variable.
Replace JSON constants that are incompatible with PHP 5.3.