Object constants

Implement the changes discussed in #954.