Make DB functions stable where applicable
Merge pull request #52 from txbits/kirk/db-stablefun

fixes #31 - Make DB functions stable where applicable