Add object.get() method for object

Acts like dict.get(k, v) in Python.