Wrote encoder test

Needs to be fixed for compilation, probably.