Proposal cleaning

not yet ready for merge, need real testing and also automatic tests. More for discussion of design.