optimize redeemscript map generation
add tests for Structurewq
Merge pull request #739 from maraoz/optimize/redeemscriptmap

optimize redeemscript map generation