Fixed drag vs click issues with clicking on map. Removed bad alerts. Cleaned up code by splitting into various pieces.