Optimizations, implementations, etc.

Implemented "query_pattern" method, which dramatically improves the performance of the repository querying. No specs, sorry - I'm just overwhelmed with so many failing ones already :) Maybe I'll get to fix them some day.

Accumulated a lot of code from around the project network, integrated it into the branch.