Move compilation to a role.

So that it can be used in a couple of places.