refactored database classes so they work standalone, without flask
added git ignore