Add non-generic GetDefinedAttributesFor method.

- Code refactoring.
- Add some unit tests.
Merge pull request #2 from junshao/develop

Add non-generic GetDefinedAttributesFor method.