Added dialog for when leaving page while music is playing.
Fixes for ajax alert message when leaving page.
Changes so that browsers wont spam server with requests upon request errors.