Add return statements after loops

Add `return` statements after loops as the CoffeeScript compiler will aggregate the last line in them and return that as the result of the function. We can speed up things by making it not do that.

Please make sure that I haven't accidentally put a `return` where there shouldn't be one - that is, where actually the side-effect of returning the accumulated values is used (e.g. in `frontend/modules/autolink.coffee` in the `textNodes` function).