Added a Constant Encoder. Also modified how Constant Refs are decoded, eliminating some redundant code.