Change the prepare function to beforeRender to better match the afterRender approach. Additionally, make the beforeRender return of data optional and not required.
Adding additional tests for the beforeRender change.