Value implementation

Depends on toArray implementation. Merge that one first.