Change sources encoding to UTF-8. Fix bug in saved static data. Code refactoring.