Eliminate most use of dynamic vars in favor of additional keys in map 'fmt'

Also add a few unit tests for a function I want to add new options to
soon, to help verify I don't break anything.