Move stuff to lib, add setDutyCycle
Some edits to README