use DI pattern for rails asset pipeline compatibility
Merge pull request #3 from enoptix/master

use DI pattern for rails asset pipeline compatibility
Pass JSLint