More work on javascript integration with UI