Use document's get_field method in encoder.
Create a base encoder class from which all encoders can inherit
common functionality.
Add is_array_* methods to BaseEncoder.
Replace manual array checks with is_array_* methods.
Generically implement encoder for builtins.
Reimplement QueryEncoder. Extend coverage over entire encoder module.
Support passing unencoded (raw) queries and updates.
Fix update when using custom update spec.
Extend test coverage over the remainder of modules.