turn off word wrap
abstract/standardize approach to accessing selected_database value
simplify code for updating the output view name
refactor so setting selected database has the proper side effects
rename and prune some items
use settings for caching, local variables to avoid threading issues
misc cleanup