Move functionality from devpay_complete

I moved significant functionality (author daira) moved from the deprecated
devpay_complete.py module to increase readability.