Fixed "Undefined index" times a billion

Changed options to be generated from an array, instead of one-offs.
Fixed undefined index issues by populating with a default value. Renamed
a few options so that they're all consistently named and _opts directly
maps to atts