Done. Still needs much cleanup, but is already much nicer than before.