Major rework to remove most third-party dependencies.