Unsubscribe tests

Unit tests for the unsubscribe code. Now we can happily refactor :)