Add several unit tests for ProjectParser

In order to write unittest for this class. I've to refactor the code to
be testable.  One important method is to split the method, split the
creation and usage of the class instance.