moved script loading in views, renamed sendmail.js to main.js as it is only used on main view
gui for main screen and some code structure surrounding it