Minor changes: move code between classes, split PartialComponent out of ComponentImpl, fix Clang warnings, add comments.