* Add OnInitialise handler. Closes #1686 * Fix typo * Fix wasm build * Add tests for initialise and finalise.