cleaned up a bunch of build + formatting
diff --git a/aos/build/aos.gyp b/aos/build/aos.gyp
index 0c1506c..84a6271 100644
--- a/aos/build/aos.gyp
+++ b/aos/build/aos.gyp
@@ -8,7 +8,6 @@
     'conditions': [
       ['OS=="crio"', {
           'libaos_source_files': [
-            '<!@(find <(AOS)/crio/controls <(AOS)/crio/messages <(AOS)/crio/motor_server -name *.c -or -name *.cpp -or -name *.cc)',
             '<(AOS)/crio/Talon.cpp',
           ],
         }, {
diff --git a/aos/build/create_aos_ctdt.sh b/aos/build/create_aos_ctdt.sh
index 63c927c..6bf0a62 100755
--- a/aos/build/create_aos_ctdt.sh
+++ b/aos/build/create_aos_ctdt.sh
@@ -9,4 +9,3 @@
 echo 'void aos_call_init_functions() {'
 echo -e $calls
 echo '}'
-
diff --git a/aos/common/messages/QueueHolder.h b/aos/common/messages/QueueHolder.h
index 2b7c0d7..23ddc95 100644
--- a/aos/common/messages/QueueHolder.h
+++ b/aos/common/messages/QueueHolder.h
@@ -6,11 +6,14 @@
 
 #include <algorithm>
 
-#include "aos/aos_core.h"
 #include "aos/common/control_loop/Timing.h"
 #include "aos/common/byteorder.h"
 #include "aos/common/time.h"
 #include "aos/common/type_traits.h"
+#include "aos/common/logging/logging.h"
+#ifndef __VXWORKS__
+#include "aos/atom_code/ipc_lib/queue.h"
+#endif
 
 namespace aos {
 
diff --git a/aos/common/messages/messages.gyp b/aos/common/messages/messages.gyp
index 94508c4..e7669c7 100644
--- a/aos/common/messages/messages.gyp
+++ b/aos/common/messages/messages.gyp
@@ -1,6 +1,33 @@
 {
   'targets': [
     {
+      'target_name': 'QueueHolder',
+      'type': 'static_library',
+      'sources': [
+        # 'QueueHolder.h'
+      ],
+      'dependencies': [
+        '<(AOS)/common/common.gyp:timing',
+        '<(AOS)/common/common.gyp:time',
+        '<(AOS)/build/aos.gyp:logging',
+      ],
+      'export_dependent_settings': [
+        '<(AOS)/common/common.gyp:timing',
+        '<(AOS)/common/common.gyp:time',
+        '<(AOS)/build/aos.gyp:logging',
+      ],
+      'conditions': [
+        ['OS!="crio"', {
+          'dependencies': [
+            '<(AOS)/atom_code/ipc_lib/ipc_lib.gyp:ipc_lib',
+          ],
+          'export_dependent_settings': [
+            '<(AOS)/atom_code/ipc_lib/ipc_lib.gyp:ipc_lib',
+          ],
+        }],
+      ],
+    },
+    {
       'target_name': 'aos_queues',
       'type': 'static_library',
       'sources': [
diff --git a/aos/crio/controls/ControlsManager.cpp b/aos/crio/controls/ControlsManager.cpp
index c1f11cd..cfc429b 100644
--- a/aos/crio/controls/ControlsManager.cpp
+++ b/aos/crio/controls/ControlsManager.cpp
@@ -1,10 +1,11 @@
+#include "aos/crio/controls/ControlsManager.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 
 #include "WPILib/Compressor.h"
 
 #include "aos/crio/logging/crio_logging.h"
-#include "aos/crio/controls/ControlsManager.h"
 #include "aos/common/Configuration.h"
 #include "aos/crio/aos_ctdt.h"
 #include "aos/crio/motor_server/CRIOControlLoopRunner.h"
@@ -50,4 +51,4 @@
 }
 
 }  // namespace crio
-} // namespace aos
+}  // namespace aos
diff --git a/aos/crio/controls/controls.gyp b/aos/crio/controls/controls.gyp
new file mode 100644
index 0000000..2dd7098
--- /dev/null
+++ b/aos/crio/controls/controls.gyp
@@ -0,0 +1,22 @@
+{
+  'targets': [
+    {
+      'target_name': 'ControlsManager',
+      'type': 'static_library',
+      'sources': [
+        'ControlsManager.cpp',
+        'JoyStickRead.cpp',
+      ],
+      'dependencies': [
+        '<(EXTERNALS):WPILib',
+        '<(AOS)/build/aos.gyp:logging',
+        '<(AOS)/common/common.gyp:common',
+        '<(AOS)/crio/motor_server/motor_server.gyp:CRIOControlLoopRunner',
+        '<(AOS)/crio/motor_server/motor_server.gyp:MotorServer',
+      ],
+      'export_dependent_settings': [
+        '<(EXTERNALS):WPILib',
+      ],
+    },
+  ],
+}
diff --git a/aos/crio/motor_server/CRIOControlLoopRunner.cpp b/aos/crio/motor_server/CRIOControlLoopRunner.cc
similarity index 96%
rename from aos/crio/motor_server/CRIOControlLoopRunner.cpp
rename to aos/crio/motor_server/CRIOControlLoopRunner.cc
index 1971dc1..a4cf3ce 100644
--- a/aos/crio/motor_server/CRIOControlLoopRunner.cpp
+++ b/aos/crio/motor_server/CRIOControlLoopRunner.cc
@@ -1,6 +1,6 @@
 #include "CRIOControlLoopRunner.h"
 
-#include "aos/aos_core.h"
+#include "aos/common/logging/logging.h"
 #include "aos/crio/shared_libs/interrupt_bridge.h"
 #include "aos/crio/motor_server/MotorOutput.h"
 #include "aos/crio/motor_server/MotorServer.h"
diff --git a/aos/crio/motor_server/MotorControllerOutput.cpp b/aos/crio/motor_server/MotorControllerOutput.cc
similarity index 98%
rename from aos/crio/motor_server/MotorControllerOutput.cpp
rename to aos/crio/motor_server/MotorControllerOutput.cc
index a0897b4..7b24892 100644
--- a/aos/crio/motor_server/MotorControllerOutput.cpp
+++ b/aos/crio/motor_server/MotorControllerOutput.cc
@@ -1,6 +1,5 @@
 #include "aos/crio/motor_server/MotorControllerOutput.h"
 
-#include "aos/aos_core.h"
 #include "aos/common/byteorder.h"
 #include "aos/common/commonmath.h"
 
diff --git a/aos/crio/motor_server/MotorOutput.cpp b/aos/crio/motor_server/MotorOutput.cc
similarity index 100%
rename from aos/crio/motor_server/MotorOutput.cpp
rename to aos/crio/motor_server/MotorOutput.cc
diff --git a/aos/crio/motor_server/MotorServer.cpp b/aos/crio/motor_server/MotorServer.cc
similarity index 99%
rename from aos/crio/motor_server/MotorServer.cpp
rename to aos/crio/motor_server/MotorServer.cc
index 77a0579..ebb69fd 100644
--- a/aos/crio/motor_server/MotorServer.cpp
+++ b/aos/crio/motor_server/MotorServer.cc
@@ -3,12 +3,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "usrLib.h"
-#include "aos/common/inttypes.h"
 
 #include "WPILib/Timer.h"
 #include "WPILib/Task.h"
 
-#include "aos/aos_core.h"
+#include "aos/common/inttypes.h"
 #include "aos/crio/motor_server/MotorControllerOutput.h"
 #include "aos/crio/motor_server/SolenoidOutput.h"
 #include "aos/common/Configuration.h"
diff --git a/aos/crio/motor_server/OutputDevice.h b/aos/crio/motor_server/OutputDevice.h
index 0789a68..7cd4983 100644
--- a/aos/crio/motor_server/OutputDevice.h
+++ b/aos/crio/motor_server/OutputDevice.h
@@ -1,5 +1,5 @@
-#ifndef __CRIO_MOTOR_SERVER_OUTPUT_DEVICE_H_
-#define __CRIO_MOTOR_SERVER_OUTPUT_DEVICE_H_
+#ifndef AOS_CRIO_MOTOR_SERVER_OUTPUT_DEVICE_H_
+#define AOS_CRIO_MOTOR_SERVER_OUTPUT_DEVICE_H_
 
 #include <stdint.h>
 #include "aos/crio/shared_libs/ByteBuffer.h"
@@ -20,7 +20,6 @@
   virtual void NoValue() = 0;
 };
 
-} // namespace aos
+}  // namespace aos
 
-#endif
-
+#endif  // AOS_CRIO_MOTOR_SERVER_OUTPUT_DEVICE_H_
diff --git a/aos/crio/motor_server/SensorOutput.cpp b/aos/crio/motor_server/SensorOutput.cc
similarity index 100%
rename from aos/crio/motor_server/SensorOutput.cpp
rename to aos/crio/motor_server/SensorOutput.cc
diff --git a/aos/crio/motor_server/SensorSender-tmpl.h b/aos/crio/motor_server/SensorSender-tmpl.h
index 93fe73d..0ec303c 100644
--- a/aos/crio/motor_server/SensorSender-tmpl.h
+++ b/aos/crio/motor_server/SensorSender-tmpl.h
@@ -1,5 +1,6 @@
 #include "WPILib/Task.h"
 #include "WPILib/Timer.h"
+
 #include "aos/crio/motor_server/SensorOutput.h"
 #include "aos/common/network/SendSocket.h"
 #include "aos/common/Configuration.h"
diff --git a/aos/crio/motor_server/SensorSender.h b/aos/crio/motor_server/SensorSender.h
index 135e1fa..c42fbfb 100644
--- a/aos/crio/motor_server/SensorSender.h
+++ b/aos/crio/motor_server/SensorSender.h
@@ -1,5 +1,5 @@
-#ifndef __CRIO_SENSOR_SENDER_H_
-#define __CRIO_SENSOR_SENDER_H_
+#ifndef AOS_CRIO_MOTOR_SERVER_SENSOR_SENDER_H_
+#define AOS_CRIO_MOTOR_SERVER_SENSOR_SENDER_H_
 
 namespace aos {
 
@@ -15,9 +15,8 @@
    void Run();
 };
 
-} // namespace aos
+}  // namespace aos
 
 #include "SensorSender-tmpl.h"
 
-#endif
-
+#endif  // AOS_CRIO_MOTOR_SERVER_SENSOR_SENDER_H_
diff --git a/aos/crio/motor_server/motor_server.gyp b/aos/crio/motor_server/motor_server.gyp
new file mode 100644
index 0000000..01f5353
--- /dev/null
+++ b/aos/crio/motor_server/motor_server.gyp
@@ -0,0 +1,73 @@
+{
+  'targets': [
+    {
+      'target_name': 'CRIOControlLoopRunner',
+      'type': 'static_library',
+      'sources': [
+        # 'ControlLoopGoals.h'
+        'CRIOControlLoopRunner.cc',
+      ],
+      'dependencies': [
+        '<(EXTERNALS):WPILib',
+        '<(AOS)/common/common.gyp:mutex',
+        '<(AOS)/common/common.gyp:controls',
+        '<(AOS)/crio/shared_libs/shared_libs.gyp:interrupt_notifier',
+        'output',
+        '<(AOS)/build/aos.gyp:logging',
+      ],
+      'export_dependent_settings': [
+        '<(EXTERNALS):WPILib',
+        '<(AOS)/common/common.gyp:mutex',
+        '<(AOS)/common/common.gyp:controls',
+      ],
+    },
+    {
+      'target_name': 'output',
+      'type': 'static_library',
+      'sources': [
+        # 'OutputDevice.h',
+        # 'SensorSender-tmpl.h',
+        'SensorOutput.cc',
+        # 'SolenoidOutput.h'
+        'MotorControllerOutput.cc',
+        'MotorOutput.cc',
+      ],
+      'dependencies': [
+        '<(EXTERNALS):WPILib',
+        '<(AOS)/common/network/network.gyp:socket',
+        '<(AOS)/common/common.gyp:common',
+      ],
+      'export_dependent_settings': [
+        '<(EXTERNALS):WPILib',
+        '<(AOS)/common/network/network.gyp:socket',
+        '<(AOS)/common/common.gyp:common',
+      ],
+    },
+    {
+      'target_name': 'MotorServer',
+      'type': 'static_library',
+      'sources': [
+        'MotorServer.cc',
+      ],
+      'dependencies': [
+        '<(EXTERNALS):WPILib',
+        '<(AOS)/common/common.gyp:controls',
+        '<(AOS)/common/common.gyp:mutex',
+        '<(AOS)/common/messages/messages.gyp:QueueHolder',
+        '<(AOS)/common/network/network.gyp:socket',
+        'CRIOControlLoopRunner',
+        '<(AOS)/crio/shared_libs/shared_libs.gyp:ByteBuffer',
+        'output',
+      ],
+      'export_dependent_settings': [
+        '<(EXTERNALS):WPILib',
+        '<(AOS)/common/common.gyp:controls',
+        '<(AOS)/common/common.gyp:mutex',
+        '<(AOS)/common/messages/messages.gyp:QueueHolder',
+        '<(AOS)/common/network/network.gyp:socket',
+        'CRIOControlLoopRunner',
+        '<(AOS)/crio/shared_libs/shared_libs.gyp:ByteBuffer',
+      ],
+    },
+  ],
+}
diff --git a/aos/crio/shared_libs/ByteBuffer.h b/aos/crio/shared_libs/ByteBuffer.h
index b5c4902..f1cf60a 100644
--- a/aos/crio/shared_libs/ByteBuffer.h
+++ b/aos/crio/shared_libs/ByteBuffer.h
@@ -1,8 +1,9 @@
-#ifndef __CRIO_SHARED_LIBS_BYTE_BUFFER_H_
-#define __CRIO_SHARED_LIBS_BYTE_BUFFER_H_
+#ifndef AOS_CRIO_SHARED_LIBS_BYTE_BUFFER_H_
+#define AOS_CRIO_SHARED_LIBS_BYTE_BUFFER_H_
+
+#include <algorithm>
 
 #include "aos/common/network/ReceiveSocket.h"
-#include <algorithm>
 
 namespace aos {
 
@@ -85,7 +86,6 @@
    }
 };
 
-} // namespace aos
+}  // namespace aos
 
-#endif
-
+#endif  // AOS_CRIO_SHARED_LIBS_BYTE_BUFFER_H_
diff --git a/aos/crio/shared_libs/shared_libs.gyp b/aos/crio/shared_libs/shared_libs.gyp
index 90b3cf0..78287c1 100644
--- a/aos/crio/shared_libs/shared_libs.gyp
+++ b/aos/crio/shared_libs/shared_libs.gyp
@@ -1,13 +1,40 @@
 {
   'targets': [
     {
-# This one includes interrupt_bridge.h too.
+      'target_name': 'limit_encoder_reader',
+      'type': 'static_library',
+      'sources': [
+        'limit_encoder_reader.cc',
+      ],
+      'dependencies': [
+        '<(EXTERNALS):WPILib',
+        'interrupt_notifier',
+      ],
+      'export_dependent_settings': [
+        '<(EXTERNALS):WPILib',
+      ],
+    },
+    {
+      'target_name': 'ByteBuffer',
+      'type': 'static_library',
+      'sources': [
+        # 'ByteBuffer.h',
+      ],
+      'dependencies': [
+        '<(AOS)/common/network/network.gyp:socket',
+      ],
+      'export_dependent_settings': [
+        '<(AOS)/common/network/network.gyp:socket',
+      ],
+    },
+    {
       'target_name': 'interrupt_notifier',
       'type': 'static_library',
       'sources': [
         'interrupt_bridge.cc',
         'interrupt_bridge_c.c',
         'interrupt_bridge_demo.cc',
+        # 'interrupt_notifier-tmpl.h',
       ],
       'dependencies': [
         '<(AOS)/common/common.gyp:time',
diff --git a/frc971/crio/crio.gyp b/frc971/crio/crio.gyp
index b91b32d..330a6fa 100644
--- a/frc971/crio/crio.gyp
+++ b/frc971/crio/crio.gyp
@@ -29,6 +29,8 @@
         'WPILib_changes',
         '<(EXTERNALS):WPILib',
         '<(AOS)/common/messages/messages.gyp:aos_queues',
+        '<(AOS)/crio/controls/controls.gyp:ControlsManager',
+        '<(AOS)/crio/motor_server/motor_server.gyp:CRIOControlLoopRunner',
       ],
     },
     {
@@ -42,7 +44,6 @@
       'target_name': 'FRC_UserProgram_WithTests',
       'type': 'shared_library',
       'dependencies': [
-        'user_program',
         # For testing.
         '<(AOS)/build/aos_all.gyp:Crio',
       ],
diff --git a/frc971/input/input.gyp b/frc971/input/input.gyp
index c62365b..2abeac8 100644
--- a/frc971/input/input.gyp
+++ b/frc971/input/input.gyp
@@ -59,6 +59,7 @@
         '<(AOS)/build/aos.gyp:libaos',
         '<(DEPTH)/frc971/control_loops/control_loops.gyp:control_loops',
         '<(AOS)/crio/shared_libs/shared_libs.gyp:interrupt_notifier',
+        '<(AOS)/crio/shared_libs/shared_libs.gyp:limit_encoder_reader',
       ],
     },
     {
diff --git a/frc971/queues/queues.gyp b/frc971/queues/queues.gyp
index 70ed873..6219db2 100644
--- a/frc971/queues/queues.gyp
+++ b/frc971/queues/queues.gyp
@@ -3,6 +3,7 @@
     'queue_files': [
       'GyroAngle.q',
       'Piston.q',
+      'Temp.q',
     ]
   },
   'targets': [