Code review
Merge pull request #1 from kasperg/review

Core code review