Bring back 'data-type' attributes

It's used by legacy scripts
Fix castControlAttribute function name
Pass through dynamic values
`bare` option to not use toString for values
Generate number attributes from relations bare