moved attrdict to its own file. added tests.