Fix: Database: Get new reference after reauth

While we were updating the nano reference
inside of nanoo, when reestablishing our
connection and authorization, this reference
wasn't being updated in database.js, resulting
in authentication failures.

Fixed the situation by emitting an event when
we establish a new connection, and updating
the reference in database.js when this happens.