Converting class into jQuery-plugin