Improved data sanitization, and made db.py more user friendly