Preliminary version: Pin/Timer interrupts

I have been fighting with external interrupts, routine was called too often, not sure why... Tested Pin interrupt instead, works as intended so switched to it.
Timer interrupt implemented and works fine.

This is a simple example switching between Pin and Timer interrupts.