Bugfixes

Various bugfixes, esp in the posts edit page. 
Also modified several pages to pass the JSON directly to the page during rendering instead of having the js do a GET call.
Removed old unecessary code.