Added "init" function and cleaned up Makefiles.

Reduces duplication between tests.