Enabled to import mask file. Refs #9643.

Also
1. Add unit test file;
2. Write a new unit test for it;