Implement db:pull and db:push

I think I've finally got it working. I just did a successful pull. Not the prettiest code I've written but it works.