Move some code around. Add initial Encoder specs.