Encoder rewrite

Cleaned up the structuring of the encoder and added simple system argument support.