Add tests verifying declaration of generated code is compatible
Fix newinstance to generate code declaration-compatible w/ base