A little cleanup

some cleanup and dead code removal
added a couple more console.log() calls to trace code flow in mapping.js