Outsource patterns
Add jQuery and custom methods
Merge master with local changes