Issue171 hysteris controller

This pull request replaces #171 .
I propose a new implementation of the hysteresis which is general for heating and cooling, which has conditional inputs and release. I also updated the examples and their unit tests.