Add simple runtime contracts to R values. These ensure that values fulfil certain conditions and will raise appropriate errors if they do not.