Pub changes

Mostly tools and extra tests and new keywords. Nothing in here should change the semantic of existing pub code.