Separate out functionality into logical modules

Also renamed the glsl shaders to match the new scheme