Refactored to a common base

Note: only the spherical simulation is working at present.