Have the search return JSON instead of HTML so that it can easily be used by Angular.
Have the output class only return JSON since HTML is no longer used.
Pulled the truncate method out of prepareHTML and made it into a separate method.