Engineering Formal Systems In Constructive Type Theory