Additional refactoring and bumped patch version.
Added history saving to output file.