refactored use of formatting to mostly templates;

moved resource manager to separate module;