Added documention for core programming structure. Added test cases as we...

Same pull request as https://github.com/groovy/groovy-core/pull/477. 
This line is an artifact of your merge conflicts you've been facing.
You should try to remove that line with an additional commit on that branch.