Updated Dao implementations.

Updated all the Dao implementations. Now they're using named parameters,
and all the queries should be compatible with Hibernate 4.X.X.