Added a (basically) proper assert module and used that to replace the scattered if-throws.