Redid field IDs so that they work with groups.

Addresses issue #1387.
Fixed stylization problems cause by rubocop.