Attribute expressions

closes #659
Also, missing handling of Option types.