Physics

Near-working physics system, additional tests, and some bug fixes.