Added requireJS to improve work with js libraries
Cleaning up a little
Moving the queries and some logic to its own class.