Added unit test for mask stack.
Merge pull request #47 from rybern/fix

Added unit test for mask stack.