Native JavaScript to register deviceready function