Implement Value as union-like class

This should fix the issue #36