Added the element parameter to its callbacks

Adjusted and improved the testElementCallbacks test.

Resolves #1887