Moved the compass code into a library and updated the rudder protoype to use it