Updated JS to wait for async functions

Rather then setting global data from an ajax request and hoping it will be
there, the getLocation function will take an opts object with success and
error callbacks. The success callback is implemented so it recieves the location
data and makes the POST request to the backend. The error conditions should
be handled more specifically.

Also added a specific event handler to the click event, which would make it
easier for testing and keeps functions smaller.

Todo:
- Put function documentation

Questions:
- Does the pingHeroku ajax request need to be completed before any of the app
code runs?
- If so, what should be done if that request doesn't return?