More work on the JS wrapper