Further progress on @enum

Combined the static member approach with the companion object approach,
looks like we need both to make Java and Scala happy.