Add program rule support, various other fixes

Hi, awesome work on the module! A couple of suggestions for fixes/improvements as per the pull request:

* Correct existing example param
* Add in program support for rules
* Fix up idempotent issue causing rules to be created several times
* Remove some whitespace