fixes for ruby 1.9.3
- move query to its own class - use postgres ILIKE case insensitive - removed duplicated list of trust levels