Add a dipole test and rework makefiles.