fixed exposed console references, and modal bug.

fixed modal bug where duality thinks we are looking in_page when we just
closed a modal. via @wombleton

sporadically at times on first access to duality we are presented with
the ReferencError("console is not defined") couchdb error.  attempt to
fix that by making sure console.log is defined in the module.
/cc @ryanramage