Quick fix for an emulator issue

Made hex2ba a public function so that it can be called from external
files (allowing us to do stuff like responding to learning mode calls)