set stage for rearchitecture of appiumutils.js

and make these things testable!