Thanks for looking into the code and also showing me the correct way of integrating sensors. Seems there are a plethora of sensor drivers available. I would definitely try and port my code to JS so that it uses your framework in the intended fashion.
Yes as you might have seen, my code was very specific to nrf52, but after seeing the JS code i believe I can write the JS equivalents and push the sensor libs for the remaining sensors (LIS2MDL , LIS3DH, OPT3001). I am not a pro with JS (I am mostly into embedded Android, apps and J2EE in my day job) but it would be good excuse to learn JS :)
Will keep the forum posted on the developments.