add tests to sample package; fix load/unload behavior