add chapter6 code

Hi, @slackmoehrle 
We must release a new version recently, so I am busy testing the engine code.
I have already written a few sample code in chapter6. 
More needed to be added in the near future.