Added support for moc generation

This is needed for by Qt files that uses Q_OBJECT in the headers to bind callbacks, etc with help of the code generator
Minor cleanup