Added ability to set attributes by nesting a dictionary instead of a string and refactored tests a bit