Refactored map manipulation out of gameaction.js
Fixed a few bugs
Misc.