Conveniance functions for checking parameteres.

Also introduces specialized exception classes for each
assertion.