Last fixes, renamings and refactors for #253. Ready to merge to development