Implement object patterns, fixes #25