Various fixes to get to alpha state

Various fixes to get scanjs to a usable state. see commits below.