Implement handle/3

Add some extra tests to make sure it works without breaking the other parts.