It also seems to be some kind of graphical bug caused by the subroutines. This is the image generated when the above shader managed to compile:
Notice the edges not being shaded? It shouldn't be like that. The cube should be as it is when no subroutines are used at all, like this:
This is produced when no subroutines are used, however the implementation is identical apart from the fact that instead of calling functions I simply run the code inline. Also note that this is only using subroutines within the fragment shader.