Adapt to ROOT coding conventions, use anonymous namespace
Use proper allocation function for struct returns (ROOT-6028).