Add some tests for the greedy matcher, and fix some issues

Matching onto nested !-boxes doesn't work currently.