Updated Encoder to use Field rather than Double, and fixed small inheritance issue in VectorSpace