Js refactor

Contains all the js code needed for the creation and saving of floor plans. Refactored for the code review from daddy.