Respin of first version to address comments and make it buildable on its own.