Added compose function. Updated tests. Updated docs.