Add set() function

Adds a chainable set() function to set properties, rather than setting directly.