Add tests and make extension testable