Updated DAO for new(er) DB design

Updated to work with latest DB design.