oop js for map drawing, refactored sql/data loading