The ground work for doing this has now been laid, updates are needed to accommodate the pre-existing constants and also generate JS code for them.