implement dump task
add rake tasks

misc tweaks/refactoring