Fixing some bugs found through test case
restructed app for rpm packaging
prior to changing db to postgres