Another try at increasing encoder accuracy, this way attempts to use interrupts, instead of the digital read commands.  This may increase exectution time, but this may be difficult to implement in a real situation (though disable interrupts could be used to mitigate this)