GROOVY-5370: ConfigSlurper - multiple environment blocks broken

All credit for the patch and tests to Richard Rattigan. I just created a pull request and did some minimal refactoring.
Merge pull request #95 from PascalSchumacher/GROOVY-5370

GROOVY-5370: ConfigSlurper - multiple environment blocks broken
merged