Various code changes to reflect new database. ***UNSTABLE***