Implemented Delivery Transaction Profile.

Also re-introduced a previously deleted section of a query. I am adding
it back after this part of the query was unceremoniously removed without
any regard to the side-effect of its removal.

Added a few TODO items as well.