Remove lots of Java code for the OS API functions. Replace with JS.