Moved serial connection setup outside of controller to allow passing any readwriteclosers