[docs] Better newclass example code in pirbook

Closes GH #802
[cage] re-add -g to CFLAGS even without --debugging

Closes #1135