Changed assert.h to cassert
Slowly adding in more of the check code