Naive implementation of macro and substring searching

probably needs a better algorithm. Eric won't like this