Merge pull request #4189 from yurydelendik/split-pattern

Refactors shared/pattern.js into core/ and display/
Basic function.js split