cleaned up location model code
fixed broken tests
reorganized javascript. added js alerts