Minor fixes to work with head versions of support libraries.

Found after running go get -u all
Convert to using Gorm for DB access