Added a tonne of features, and fixed things.