persistence wrap up

added persistence queries, query factories and co.