Add replace option, closes #10.