Pub sub

pull for #64 still needs tests and docs