Revert ptygen modifications
Fix const manglestr generation
Don't resolve template paramater during template instantiation