Dead code removal.
Major packages overhaul.
Fixup tests.
Docs update.