Refactor $.fn.bug_infobox and $.fn.user_infobox to share code.

This is the first step in refactoring the infoboxes to use backbone models and
views. The code for user and bug infoboxes was substantially similar, and
there's no reason why they had to be separate. All of the code is now shared,
and the API entry-points (`bug_infobox` and `user_infobox`) just call into the
common method and pass an ID for the infobox element.

Testing done:
Tested that both infoboxes worked as expected.

Reviewed at https://reviews.reviewboard.org/r/6053/