Got contracts ready to go.

@bsoetaer We should be ready to write contracts now.
Nice touch adding these to post and pre conditions as well so that infinite loops are less likely to be encountered when doing pre and post condition checks.