A Modular Type-checking algorithm for Type Theory with Singleton Types and Proof Irrelevance (Logical Methods in Computer Science, 2011)