add unit test for iParser & iReplace

1. add unit test for iParser & iReplace
2. iParser & iReplace partially refactored