Fix several issues

This reworks some of the error handling stuff and fixes a few things:

Fixes #14, and when integrated it will resolve atom/find-and-replace#197, atom/find-and-replace#242, and probably atom/find-and-replace#192 

TODO

* [ ] propagate errors up through the `search` and `replace` functions
* [ ] test the `search` and `replace` functions
* Integrate error handling into find and replace