Remove duplication in constants definitions.

After brushing up on Ruby metaprogramming magic, I was able to
consolidate all of the duplicated code within a `ConstHelpers` module.