Convert assertions to use exceptions where appropriate.

* Remove calls to assert()
* Defined a new AssertionException, to be used in situations where
  an assertion failure would ordinarily occur.
* Convert assertions to an appropriate exception, or remove
  (in some cases where rather redundant, especially in enumpoly).