changed database query for postgresql
added localized labels for randomization methods and added support for PostgreSQL