Refactor terrain generation and chunk handling

Fixes #35
Merge pull request #40 from Nocte-/issue35

Refactor terrain generation and chunk handling