fix errors in attribute parsing
reject definitions in header files
beef up tests to prove both of these work without any extra external help