Fixing prototypes and typos so that it now compiles.
Changed setDigitDecode to just setDecode and added a global version too.
Adding documentation and examples.