Added puzzle type JSON parser, allow abbreviated JSON
Factory class, reorganized type API and main.js (still crap)
Finished factory conversion, more hacks...
Misc. cleanup