Updated db schema to include sites.

Simplified the schema and logic.