Function composition tests: refactored and added more tests