Code cleanup.  Separated out db connection from model definition.