adapt to new BuildService api for expandPatterns

also simplify the processing
Merge pull request #6 from d0b3rm4n/expand-patterns-new-api

adapt to new BuildService api for expandPatterns