Implement constrain() in python.

Fixes https://github.com/jdf/Processing.py-Bugs/issues/77.