Large commit. See extended description for details

Huge amount of work. JS refactoring, JSON API added, added state JSON
tree object parser JS methods, dynamic UI / form construction partly
implemented, cherrypyserver.py is proper server now, server currently
serves a mock JSON string for UI construction until Kinga's methods are
finished.