Handle more url resolution edge cases
Use context to help split up nested functions

Use explicit context object to pass to bind to simplify argument passing
and de-nesting of functions