quick pass

@kevinreiss Don't merge yet. Wonder what you think of this? I need to reintegrate the OSd stuff yet...