A Topological Study of Contextuality and Modality in Quantum Mechanics