Rewritten chunk handler
Refactoring code
Fixed imports
Merge branch 'bug-fixes' into 1.0