Javascript adventures in algorithms / searching / datastructures