Added Constants class and updated value encoder to use these constants instead of magic numbers.