allow cancelling of an upload during it

note this currently only aborts the last ajax request
depends on #20 which should also close the popup dialog
allow asynchronous pages

this allows the showPage to take a second parameter -a deferred object
If given then it shows a loader and attaches a done callback that clears the loader

rearranged showMonumentsList function accordingly
deal with upload errors

deal with 200 responses that contain error messages on a failed upload
add generic error handler for displaying these errors with cancel button
hide all existing popups when showing a page (this deals with the case where
the uploading status message popup is open and then loads the error popup)

when cancelling the error message the previous upload screen is shown hence
the update of upload message
see #21 for cancelling an upload
Merge pull request #23 from jdlrobson/failedupload

deal with upload errors
store user location for use elsewhere in app
calculate distance estimate between two points

implement haversine function
display the distance on the search result
add filters to top of list of monuments

this allows filtering of monuments by name, distance and address
it uses a data property 'sortby' to allow extensibility

refactored the rendering of monuments list to attach distance to
monuments pre sort

slight adjustment to css of buttons
add splash screen for when looking up location

geolocation can sometimes take a while - it would be good to tell
users that something is happening so they do not click again
TODO: add some nice graphics here / review copy text
Merge pull request #26 from jdlrobson/38062

38062
Merge branch 'master' of github.com:wikimedia/WLMMobile into async-pages

Conflicts:
	assets/www/js/app.js
Merge branch 'master' of github.com:wikimedia/WLMMobile into async-pages

Conflicts:
	assets/www/js/app.js
sort countries by name (bug 38057)
Merge remote-tracking branch 'jdlrobson/async-pages' into tmp
clear existing search results before a sort

needed due to changes implemented in  444fe0fd0bb16119762ad2c59b3a88ea11a8fba4
on successful location lookup set default sort to distance

this seems to meet user expectation better in my opinion
fix back button for login (bug 38220)

the back button can be an anchor tag as well
Added switch for different login api error states, handling different messaging for different error groups. Attempting to use displayError() now as well.
* Adds 'state' attribute to the login form fields
* Adds corresponding css for when login form fields are in 'error' state
* Moves error messages for login errors to message file
* Highlights username/password field on error
* Uses displayError() function for login errors
* Updates login-failed message to be more generic
* Change popup dialog to not use textarea nor include default 'failure-details' message.
* displayError() now populates dialog HTML inside <p> tags
* added popup-ok message

The only places I see displayError() currently used is in handling failure cases
for image uploads, and the two areas I've implemented for login failures. I'm not sure
what impact these changes will have on image upload failures - I suspect the
'failure-details' message was intended to help wiht the upload failures. If that's
the case, perhaps it can be prepended to the error message prior to display only in
that use case, rather than ubiquitously as it seemed gratuitous for login failure
cases, and I suspect it will be overkill for many other uses of displayError() in
the future.
Merge pull request #27 from jdlrobson/tweaks

Minor tweaks