Handles options.origin as function
If options.origin is a function, call it instead of calling the default function.
Merge pull request #15 from petuomin/originfunc

Handles options.origin as function