Some minor bug fixes and PEP8 reformatting.
Added tests for HopperThreshold.
Added HopperThreshold class.