Refactor nwcheminput module.