Bug fixes, better separation of concerns and improved in-place loading
of javascript files