The Substitution Decomposition of Matchings and RNA Secondary Structures