Replaces throws with calls to Debug class methods (for easily stripping ...

...asserts at compile time if needed)

Notes:
 - it probably should be moved to its own package
 - having a custom trace (with level of debugging) would be nice