Got the database interface, and rules working now