Reimplement in PureScript/JavaScript and improve config format