Moved some code out of usaepay-cli