Tighten test logic
Add rudimentary applicative-functor support