Added code linking; added auto-generation option.

Code types can now be linked to other codes from the same to allow the
automatic application of other codes to a user's account when they enter
a code of a given type. Is not recursive.
Added the ability to have a code created that is valid for a given range
each day; makes use of the otherwise unused default to and from options.