Expanded unit formatting options

Replaced the unit formatting checkboxes with a fine-grained multi-select
control, giving greater freedom to customize unit display exactly as the
user wants. Summary shows preview of how the formatted unit will look
like, given the current unit mode and unit settings.
Refactor Common static blocks

Minor refactoring