Creates `reference` method to keep code DRY.

Removes the need for two separate functions to handle arrays and
objects.
Specifies validate module.