main.js cleanup & added some console helper functions