Added trimodal unit test
Fixed mod bug in minima finding code. Added more unit tests