Various changes to facilitate cost function mapping. Still very messy
Single-dipole search functions and examples (keeps getting stuck in local minima