Added a few library functions from design doc
Merge branch 'master' of github.com:mkjois/contract