Added support for storing arrays in database.

This function makes use of native support for arrays in PostgreSQL.
It might not be portable to MySQL or other SQL databases.

As Hibernate does not have native support for mapping array types,
a custom IntegerArrayType class implementing the UserType interface
was written to achive this functionality.