Great reference! I managed to get it working after a bit of tinkering. I ended up making my own simple raycasting funcion which assumes we are looking for an intersection on the z = 0 plane. Anyone reading this is welcome to steal it:
function simple_raycasting( dx, dy, dz, ox, oy, oz ) { var _t = oz/-dz; return [ox + dx*_t, oy + dy*_t]; }