abstract javascripts and less from main page and do some cleanups