adding abstracted file for queries fro views.py
adding queryToData function
cleaning up js
changing p to h4
abastracting queries to queries.py and using queryToData function to execute queries and return json