Add captures array to compiled path.
Clean up variables.
Record capture positions.
Make it possible to writeback to reference data.

JD_TEST_WRITEBACK=1 make test
Captures working.