Terrestrial exoplanet simulator: an error optimal planetary system integrator that permits close encounters