Update testpatches function to use datadir.

Updates the testpatches function so uses the configured
datadir as a basis for its git test commands.

This is a step towards making datadir fully configurable.
Right now we rely on the convention that datadir is called 'data'.