Improve encapsulation of Object instances.

Signed-off-by: Kristian Duske <kristian.duske@gmail.com>