Refactor search methods and formatting

Change: move search related methods from Main class to Search class.
Change: refactor formatting to use String.Format instead of custom
Format class.