Run query without refreshing page

Refactored code so that the 'Get Visits' button will run the query again
without having to refresh the page.

This means you can run a query then, once query has finished running you
can modify form inputs and run another query.