Add check that optionsAfterRender binding was provided a function

Resolves #1555 by checking that the optionsAfterRender function was provided a function and adding a test for the case.