On Topological String Theory with Calabi-Yau Backgrounds: Modularity and Boundary Conditions