Refactored out TD and TRUST parsing into library modules