Js board logic

Resolved merge conflicts and caught up branch with js and basic model logic.