Generate a mocks package from code under test

Parse the code under test for interfaces, and then generate a package
with mocks that implement those interfaces.

The mocks package can only be imported if the test code uses the
XXX_test package - and it turns out that we need some fixes for that
to work properly.