use attrdict when deserializing JSON objects

This gives us convenient attribute syntax.