Split core worm logic into its own script

The player controller is now its own tiny script. Splitting the core
logic allows an AI controller to reuse the component without duplicating
code.