added database support, lot of bug fixes
UI fixes