Refactoring dedicated clique-counting functions a bit, expanding to K5