more componentized design

Also merge: https://github.com/dimagi/commcare-hq/pull/927

Will also require changes to be made in mc-reports