Refactor serializeAttribute out of serialize
Merge pull request #1204 from bradleypriest/serializeAttribute

Refactor serializeAttribute out of serialize