Improved database seeder.

Added database connection class. Added support for dispatching events when registering new user accounts so errors can be handled asynchronously.