Added gitignore file
Improved interrupt handling

Instead of generating a new thread for each interrupt event, a thread
handler has been created, which runs in parrallel with the reader
thread. This gives few benefits:
1) No thread overhead. The only two needed threads are created in the
begining of the program.
2) Interrupt events are sequential and non-overlaping. This is very
important in state sensitive cases such as rotary encoder, where (in
multi-threaded case) due to the race condition a later event code could
be executed before the earlier event and give a false reading.
Added rotary encoder example