fix generation of templated, inheritated cppclass

According to the cython parser, alias must appear before parents.
Parents also need to be take in to account when sorting cpppxd definitions