who invented the submarine during the civil war