Adding a Javascript implementation of an Enum class