Refactored code to solve messy licensing - Apache 2.0 based code from 
bitcoinj now encasulated in inner class.