Refactor user-defined patterns

Move custom pattern functionality to separate file;
Do not use localStorage directly;
Leave connectors.js as static definition;
Apply custom patterns without browser restart;