Unify setupBar and setupHistogram

Summary:
The code here is still a bit nasty (and riddled with sort of gross "if"s), but
I figured this was a decent step forward and a good break point.

Test Plan:
* Open Perseus
* Try out bar and histogram

Reviewers: jack

Reviewed By: jack

Differential Revision: http://phabricator.khanacademy.org/D8445