Refactor some report javascript to get rid of some helpers