Code review!

This is the beginning of a code review. Don't merge! More to come!