Add more asserts to IR.cpp

Also clean up some IR.h docs. Some assumed rules were neither documented
nor enforced.