Improvements in javascript device detection