Migrate mx to work with the new couchdb structure and views