Extend resolve

Extends resolve function to accept an optional object to resolve from
and if object supplied an options object.

options.returnObject makes this function return an object
{
  keyExists: Boolean,
  value: ‘value usually return by this function’
}

This PR is related to
https://github.com/EventedMind/iron-router/pull/1084