Check functions

Closes #45 and #105
Does `stopifnot` allow you to specify a custom error message? I like to write verbose warning/error messages to make it easier for users to debug. That doesn't need to be included in this release though.