Amalgamations And Detachments Of Graphs And Hypergraphs