closes #25 - cleanup in javascript and ajax

Signed-off-by: Alexander Skjolden <alex@plastboks.net>