Computing Intersection Numbers and Bases of Cohomology Groups for Triangulated Closed Three-Dimensional Manifolds