Localization support. Frequently repeated code and text moved to functions. Almost ready, requires testing and minor changes to keep previous format.