Implemented macro-based sealed trait entity generator

Though it does not work because of some weird issue in scala compiler.