Implemented the naive implementation of subweave from https://gist.github.com/nex3/7609394.