Core code review.

Closes gh-9.