Move map Javascript to jQuery plugin