Fix arduino libraries

Copied libraries into the project to eliminate dependence on the arduino
IDE.
Removed excess code.
Generalized interrupt function to work for multiple pins.