Handles options.origin as function

If options.origin is a function, call it instead of calling the default function.