fixed some bugs
https://ecosystem.atlassian.net/browse/AO-261 
https://ecosystem.atlassian.net/browse/AO-321
https://answers.atlassian.com/questions/62817/activeobjects-and-postgresql-column-names-case-sensitivity-problems


special fix for postgresql

some code rewriting
bug fixed