Add assert and refactor assert-equal to use it

Also refactor so that error messages are more useful.