Bugfix in setSpeed() and some clean-ups
Added multithreading capabilities and minor improvements