Cleaned up code.  Switched to using DBIFactory instead of manually building DBI.  Changed to pass DBI into resource instead of having it construct it internally.