a Storey engine in JavaScript