Added the Encoder library with a compiler directive to use that or our custom encoder reading

It seems that the library is in fact more efficient than our code.