Custom Search and Replace

I am trying to make my own custom box for the search and replace. I want to feature findNext, findPrevious, Replace, ReplaceAll and Count. Right now I don’t have any code that is close to working for me. I tried this addon search/searchcursor.js but I don’t seem to get how to actually handle the response to get highlighted strings. This topic by @ahingert appears to be close to what I am looking for. codemirror-external-search