Move Resource persistence to Hibernate.

Please review and consider this pull request which migrates Resource loading and saving from iBatis to Hibernate.