Event Detect methods added

Added event detect methods for motion and door sensor.  The event_detected() function is designed to be used in a loop with other things, but unlike polling it is not going to miss the change in state of an input while the CPU is busy working on other things.