added simple database query interface; use it for log --grep option
enable compiler optimization