Committing because I can, still doesn't quite work though.

Changed server stuff quite a lot. Will probably not work with cordova,
but I think it makes development cleaner.