Final version.
Fixed clear button
Reverted database setup query
Restructured DAL
Cleaned up code and added some comments