Simple spiral implementation in Javascript.