Text this: A categorical account of composition methods in logic (extended version)