Update bfs according to jshintrc
Add comments and fixes issue
Export the bfs algorithm