Implement conversion from document to generic object.
Implement field type retrieval.
Check for value existence also when array index is passed.
Remove unused code.