adding support for string attrs
extract out module for common attr methods
use shared examples for the :allow_nil option