Restructure to existing standards and update to more closely reflect the
actual implementation of the JavaScript library.