Added database schema
Cleaned up for use without non-standard libraries