fixed http connection bug, added database analysis class

restructured and re-commented code, removed dead code parts, first
stable version