Refactor scala reflection

Additionally refactor ScalaReflection to support compile time reflection.