Implement Relay library, convert spindle control to library, add spindle to emergency stop functions