Switch to custom attributes

Benefits:
* simpler for end users (whole definition is one place);
* simpler API (currently only one public method for scripts);
* more flexible (can match elements added at runtime);
* a bit smaller memory usage.