code refactoring,
jsdoc added in Device class,
In inject.js added additional check when loading script files and calling callback function