Introduced templates and jquery for the ui framework, + various fixes