Add pre- and post-remove hooks to tiles

also make the test_app globally accessible for qunit