Fix STI attribute inheritence.
Avoid creating array unless necessary.
Add back YAML backwards compatability.
Rubocop style fixes.