Issue #2006282 by joelpittet: Refactor Attribute classes - Cleanup, Security, and Readability and minor performance.