Move collectstatic to its own function.