HUGE commit

Sorry @tonkmr , or whoever reviews it.

a