use requirejs plugin mechanism (fixes #28)