Implemented integrator

I hacked everything together into an inaccurate, broken thing that I'm
nevertheless proud of.