Merge "Add an initial start at another encoder board"
diff --git a/WORKSPACE b/WORKSPACE
index 5bd89d2..90a57b3 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -36,6 +36,10 @@
     "//debian:arm_frc_gnueabi_deps.bzl",
     arm_frc_gnueabi_deps_debs = "files",
 )
+load(
+    "//debian:python_gtk.bzl",
+    python_gtk_debs = "files",
+)
 load("//debian:packages.bzl", "generate_repositories_for_debs")
 
 generate_repositories_for_debs(python_debs)
@@ -56,6 +60,8 @@
 
 generate_repositories_for_debs(arm_frc_gnueabi_deps_debs)
 
+generate_repositories_for_debs(python_gtk_debs)
+
 new_http_archive(
     name = "python_repo",
     build_file = "debian/python.BUILD",
@@ -223,8 +229,8 @@
 new_http_archive(
     name = "matplotlib",
     build_file = "debian/matplotlib.BUILD",
-    sha256 = "4aa1efb22f74859ab5c478ff743f2fd34291fc30635f4b7cf2d67550ed226117",
-    url = "http://frc971.org/Build-Dependencies/matplotlib.tar.gz",
+    sha256 = "dc8e04123a93180bf89727bf6b5a5a0f6d210b6c1c5eaec148f7f8183abbce24",
+    url = "http://frc971.org/Build-Dependencies/matplotlib-2.tar.gz",
 )
 
 new_http_archive(
@@ -241,6 +247,13 @@
     url = "http://frc971.org/Build-Dependencies/arm_frc_gnueabi_deps.tar.gz",
 )
 
+new_http_archive(
+    name = "python_gtk",
+    build_file = "debian/python_gtk.BUILD",
+    sha256 = "850f5c1521b94c5c049c44d9107cd8ae9110696fbf054d2cb48bae9620fd4d23",
+    url = "http://frc971.org/Build-Dependencies/python_gtk.tar.gz",
+)
+
 # Downloaded from
 # https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2?revision=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2018-q2-update
 new_http_archive(
@@ -253,7 +266,7 @@
 
 new_http_archive(
     name = "cgal_repo",
+    build_file = "debian/cgal.BUILD",
     sha256 = "d564dda558570344b4caa66c5bae2cdae9ef68e07829d64f5651b25f2c6a0e9e",
     url = "http://frc971.org/Build-Dependencies/cgal-dev-4.5-2.tar.gz",
-    build_file = 'debian/cgal.BUILD',
 )
diff --git a/aos/BUILD b/aos/BUILD
index 8aa274c..dd4c04b 100644
--- a/aos/BUILD
+++ b/aos/BUILD
@@ -1,8 +1,10 @@
+load("//tools:environments.bzl", "mcu_cpus")
+load("//aos/build:queues.bzl", "queue_library")
 filegroup(
     name = "prime_binaries",
     srcs = [
-        "//aos/common/logging:log_displayer",
-        "//aos/common/logging:log_streamer",
+        "//aos/logging:log_displayer",
+        "//aos/logging:log_streamer",
         "//aos/linux_code:core",
         "//aos/linux_code/starter",
     ],
@@ -12,7 +14,7 @@
 filegroup(
     name = "prime_start_binaries",
     srcs = [
-        "//aos/common/logging:binary_log_writer",
+        "//aos/logging:binary_log_writer",
     ],
     visibility = ["//visibility:public"],
 )
@@ -22,8 +24,8 @@
     srcs = [
         # starter is hard coded to look for a non-stripped core...
         "//aos/linux_code:core",
-        "//aos/common/logging:log_streamer.stripped",
-        "//aos/common/logging:log_displayer.stripped",
+        "//aos/logging:log_streamer.stripped",
+        "//aos/logging:log_displayer.stripped",
         "//aos/linux_code/starter",
     ],
     visibility = ["//visibility:public"],
@@ -32,12 +34,21 @@
 filegroup(
     name = "prime_start_binaries_stripped",
     srcs = [
-        "//aos/common/logging:binary_log_writer.stripped",
+        "//aos/logging:binary_log_writer.stripped",
     ],
     visibility = ["//visibility:public"],
 )
 
 cc_library(
+    name = "math",
+    hdrs = [
+        "commonmath.h",
+    ],
+    compatible_with = mcu_cpus,
+    visibility = ["//visibility:public"],
+)
+
+cc_library(
     name = "once",
     srcs = [
         "once-tmpl.h",
@@ -50,11 +61,22 @@
     ],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/common:gtest_prod",
-        "//aos/common:type_traits",
+        "//aos:gtest_prod",
+        "//aos/type_traits:type_traits",
     ],
 )
 
+cc_library(
+    name = "byteorder",
+    hdrs = [
+        "byteorder.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    visibility = ["//visibility:public"],
+)
+
 cc_test(
     name = "once_test",
     srcs = [
@@ -72,3 +94,251 @@
     srcs = ["__init__.py"],
     visibility = ["//visibility:public"],
 )
+
+cc_library(
+    name="macros",
+    hdrs=(
+        "macros.h",
+    ),
+    compatible_with =  mcu_cpus + [
+        "//tools:armhf-debian",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+cc_library(
+    name = "gtest_prod",
+    hdrs = [
+        "gtest_prod.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+cc_library(
+    name = "network_port",
+    hdrs = [
+        "network_port.h",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+genrule(
+    name = "gen_print_field",
+    outs = ["print_field.cc"],
+    cmd = "$(location //aos/build/queues:print_field) $@",
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    tools = ["//aos/build/queues:print_field"],
+    visibility = ["//visibility:private"],
+)
+
+cc_library(
+    name = "queue_types",
+    srcs = [
+        "print_field_helpers.h",
+        "queue_types.cc",
+        ":gen_print_field",
+    ],
+    hdrs = [
+        "queue_types.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    deps = [
+        "//aos:byteorder",
+        ":generated_queue_headers",
+        "//aos/mutex:mutex",
+        "//aos/time:time",
+        "//aos/logging:printf_formats",
+        "//aos/linux_code/ipc_lib:core_lib",
+        "//aos/linux_code/ipc_lib:shared_mem",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+cc_test(
+    name = "queue_types_test",
+    srcs = [
+        "queue_types_test.cc",
+    ],
+    deps = [
+        ":queue_types",
+        ":test_queue",
+        "//aos/logging",
+        "//aos/testing:googletest",
+        "//aos/testing:test_logging",
+    ],
+)
+
+cc_library(
+    name = "queues",
+    hdrs = [
+        "queue.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    deps = [
+        "//aos/messages:messages",
+        "//aos/linux_code:queue",
+        "//aos/linux_code/ipc_lib:queue",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+queue_library(
+    name = "test_queue",
+    srcs = [
+        "test_queue.q",
+    ],
+)
+
+genrule(
+    name = "gen_queue_primitives",
+    outs = ["queue_primitives.h"],
+    cmd = "$(location //aos/build/queues:queue_primitives) $@",
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    tools = ["//aos/build/queues:queue_primitives"],
+    visibility = ["//visibility:private"],
+)
+
+cc_library(
+    name = "generated_queue_headers",
+    hdrs = [
+        ":gen_queue_primitives",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    visibility = ["//aos/logging:__pkg__"],
+)
+
+cc_test(
+    name = "queue_test",
+    srcs = [
+        "queue_test.cc",
+    ],
+    deps = [
+        "//aos:die",
+        ":test_queue",
+        "//aos/util:thread",
+        "//aos/testing:googletest",
+        "//aos/testing:test_shm",
+    ],
+)
+
+cc_library(
+    name = "unique_malloc_ptr",
+    hdrs = [
+        "unique_malloc_ptr.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+cc_library(
+    name = "condition",
+    srcs = [
+        "condition.cc",
+    ],
+    hdrs = [
+        "condition.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    deps = [
+        "//aos/mutex:mutex",
+        "//aos/logging",
+        "//aos/linux_code/ipc_lib:aos_sync",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+cc_test(
+    name = "condition_test",
+    srcs = [
+        "condition_test.cc",
+    ],
+    deps = [
+        ":condition",
+        "//aos:die",
+        "//aos/mutex:mutex",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/util:thread",
+        "//aos/linux_code/ipc_lib:aos_sync",
+        "//aos/linux_code/ipc_lib:core_lib",
+        "//aos/testing:googletest",
+        "//aos/testing:prevent_exit",
+        "//aos/testing:test_shm",
+    ],
+)
+
+cc_library(
+    name = "die",
+    srcs = [
+        "die.cc",
+    ],
+    hdrs = [
+        "die.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    deps = [
+        "//aos:macros",
+        "//aos/libc:aos_strerror",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+
+cc_test(
+    name = "die_test",
+    srcs = [
+        "die_test.cc",
+    ],
+    deps = [
+        ":die",
+        "//aos/testing:googletest",
+    ],
+)
+
+cc_library(
+    name = "event",
+    srcs = [
+        "event.cc",
+    ],
+    hdrs = [
+        "event.h",
+    ],
+    deps = [
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/linux_code/ipc_lib:aos_sync",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+cc_test(
+    name = "event_test",
+    srcs = [
+        "event_test.cc",
+        ],
+    deps = [
+        ":event",
+        "//aos/time:time",
+        "//aos/testing:googletest",
+        "//aos/testing:test_logging",
+    ],
+)
diff --git a/aos/common/actions/BUILD b/aos/actions/BUILD
similarity index 65%
rename from aos/common/actions/BUILD
rename to aos/actions/BUILD
index 191d4cf..c4082ab 100644
--- a/aos/common/actions/BUILD
+++ b/aos/actions/BUILD
@@ -13,12 +13,12 @@
     'actor.h',
   ],
   deps = [
-    '//aos/common/logging',
-    '//aos/common:queues',
-    '//aos/common/logging:queue_logging',
-    '//aos/common:time',
-    '//aos/common/controls:control_loop',
-    '//aos/common/util:phased_loop',
+    '//aos/logging',
+    '//aos:queues',
+    '//aos/logging:queue_logging',
+    '//aos/time:time',
+    '//aos/controls:control_loop',
+    '//aos/util:phased_loop',
   ],
 )
 
@@ -49,11 +49,11 @@
     ':action_lib',
     ':test_action_queue',
     '//aos/testing:test_shm',
-    '//aos/common/logging',
-    '//aos/common/logging:queue_logging',
-    '//aos/common:queues',
-    '//aos/common:time',
+    '//aos/logging',
+    '//aos/logging:queue_logging',
+    '//aos:queues',
+    '//aos/time:time',
     ':action_queue',
-    '//aos/common:event',
+    '//aos:event',
   ],
 )
diff --git a/aos/common/actions/action_test.cc b/aos/actions/action_test.cc
similarity index 98%
rename from aos/common/actions/action_test.cc
rename to aos/actions/action_test.cc
index 1538d03..09e279c 100644
--- a/aos/common/actions/action_test.cc
+++ b/aos/actions/action_test.cc
@@ -6,12 +6,12 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/queue.h"
-#include "aos/common/actions/actor.h"
-#include "aos/common/actions/actions.h"
-#include "aos/common/actions/actions.q.h"
-#include "aos/common/actions/test_action.q.h"
-#include "aos/common/event.h"
+#include "aos/queue.h"
+#include "aos/actions/actor.h"
+#include "aos/actions/actions.h"
+#include "aos/actions/actions.q.h"
+#include "aos/actions/test_action.q.h"
+#include "aos/event.h"
 #include "aos/testing/test_shm.h"
 
 namespace aos {
diff --git a/aos/common/actions/actions.cc b/aos/actions/actions.cc
similarity index 97%
rename from aos/common/actions/actions.cc
rename to aos/actions/actions.cc
index ff3f386..11a7f03 100644
--- a/aos/common/actions/actions.cc
+++ b/aos/actions/actions.cc
@@ -1,4 +1,4 @@
-#include "aos/common/actions/actions.h"
+#include "aos/actions/actions.h"
 
 namespace aos {
 namespace common {
diff --git a/aos/common/actions/actions.h b/aos/actions/actions.h
similarity index 97%
rename from aos/common/actions/actions.h
rename to aos/actions/actions.h
index 07e569e..55dcd26 100644
--- a/aos/common/actions/actions.h
+++ b/aos/actions/actions.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_ACTIONS_ACTIONS_H_
-#define AOS_COMMON_ACTIONS_ACTIONS_H_
+#ifndef AOS_ACTIONS_ACTIONS_H_
+#define AOS_ACTIONS_ACTIONS_H_
 
 #include <inttypes.h>
 #include <sys/types.h>
@@ -9,9 +9,9 @@
 #include <atomic>
 #include <memory>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/queue.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/logging/logging.h"
+#include "aos/queue.h"
+#include "aos/logging/queue_logging.h"
 
 namespace aos {
 namespace common {
@@ -355,4 +355,4 @@
 }  // namespace common
 }  // namespace aos
 
-#endif  // AOS_COMMON_ACTIONS_ACTIONS_H_
+#endif  // AOS_ACTIONS_ACTIONS_H_
diff --git a/aos/common/actions/actions.q b/aos/actions/actions.q
similarity index 100%
rename from aos/common/actions/actions.q
rename to aos/actions/actions.q
diff --git a/aos/common/actions/actor.cc b/aos/actions/actor.cc
similarity index 76%
rename from aos/common/actions/actor.cc
rename to aos/actions/actor.cc
index 6c6bef7..7b2264d 100644
--- a/aos/common/actions/actor.cc
+++ b/aos/actions/actor.cc
@@ -1,4 +1,4 @@
-#include "aos/common/actions/actor.h"
+#include "aos/actions/actor.h"
 
 namespace aos {
 namespace common {
diff --git a/aos/common/actions/actor.h b/aos/actions/actor.h
similarity index 95%
rename from aos/common/actions/actor.h
rename to aos/actions/actor.h
index d2d05fc..5c4ebf6 100644
--- a/aos/common/actions/actor.h
+++ b/aos/actions/actor.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_ACTIONS_ACTOR_H_
-#define AOS_COMMON_ACTIONS_ACTOR_H_
+#ifndef AOS_ACTIONS_ACTOR_H_
+#define AOS_ACTIONS_ACTOR_H_
 
 #include <stdio.h>
 #include <inttypes.h>
@@ -7,11 +7,11 @@
 #include <chrono>
 #include <functional>
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/time.h"
-#include "aos/common/util/phased_loop.h"
+#include "aos/controls/control_loop.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/time/time.h"
+#include "aos/util/phased_loop.h"
 
 namespace aos {
 namespace common {
@@ -248,4 +248,4 @@
 }  // namespace common
 }  // namespace aos
 
-#endif  // AOS_COMMON_ACTIONS_ACTOR_H_
+#endif  // AOS_ACTIONS_ACTOR_H_
diff --git a/aos/common/actions/test_action.q b/aos/actions/test_action.q
similarity index 93%
rename from aos/common/actions/test_action.q
rename to aos/actions/test_action.q
index 3451c04..2ed3b4a 100644
--- a/aos/common/actions/test_action.q
+++ b/aos/actions/test_action.q
@@ -1,6 +1,6 @@
 package aos.common.actions;
 
-import "aos/common/actions/actions.q";
+import "aos/actions/actions.q";
 
 queue_group TestActionQueueGroup {
   implements aos.common.actions.ActionQueueGroup;
diff --git a/aos/build/queues.bzl b/aos/build/queues.bzl
index 840b4fe..26c2cf8 100644
--- a/aos/build/queues.bzl
+++ b/aos/build/queues.bzl
@@ -107,9 +107,9 @@
     hdrs = [src + '.h' for src in srcs],
     deps = deps + [
       '//aos:once',
-      '//aos/common:queues',
-      '//aos/common:queue_types',
-      '//aos/common/logging:printf_formats',
+      '//aos:queues',
+      '//aos:queue_types',
+      '//aos/logging:printf_formats',
     ],
     visibility = visibility,
     compatible_with = compatible_with,
diff --git a/aos/build/queues/compiler.rb b/aos/build/queues/compiler.rb
index f47763d..6ca141d 100644
--- a/aos/build/queues/compiler.rb
+++ b/aos/build/queues/compiler.rb
@@ -105,11 +105,11 @@
   cpp_tree = output_file.make_cpp_tree($src_filename)
 
   cpp_tree.add_cc_include(($src_filename + ".h").inspect)
-  cpp_tree.add_cc_include("aos/common/byteorder.h".inspect)
+  cpp_tree.add_cc_include("aos/byteorder.h".inspect)
   cpp_tree.add_cc_include("<inttypes.h>")
-  cpp_tree.add_cc_include("aos/common/queue_types.h".inspect)
+  cpp_tree.add_cc_include("aos/queue_types.h".inspect)
   cpp_tree.add_cc_include("aos/once.h".inspect)
-  cpp_tree.add_cc_include("aos/common/logging/printf_formats.h".inspect)
+  cpp_tree.add_cc_include("aos/logging/printf_formats.h".inspect)
   cpp_tree.add_cc_using("::aos::to_network")
   cpp_tree.add_cc_using("::aos::to_host")
 
diff --git a/aos/build/queues/output/q_file.rb b/aos/build/queues/output/q_file.rb
index a2f438d..1e39247 100644
--- a/aos/build/queues/output/q_file.rb
+++ b/aos/build/queues/output/q_file.rb
@@ -37,8 +37,8 @@
 	def make_cpp_tree(rel_path)
 		cpp_tree = DepFilePair.new(rel_path)
 		cpp_tree.add_header_include("<array>")
-		cpp_tree.add_header_include("\"aos/common/macros.h\"")
-		cpp_tree.add_header_include("\"aos/common/queue.h\"")
+		cpp_tree.add_header_include("\"aos/macros.h\"")
+		cpp_tree.add_header_include("\"aos/queue.h\"")
 		@class_types.each do |type|
 			cpp_tree.get(type)
 		end
diff --git a/aos/build/queues/print_field.rb b/aos/build/queues/print_field.rb
index 65837ee..4f26d04 100644
--- a/aos/build/queues/print_field.rb
+++ b/aos/build/queues/print_field.rb
@@ -15,10 +15,10 @@
 #include <inttypes.h>
 #include <stdio.h>
 
-#include "aos/common/byteorder.h"
-#include "aos/common/time.h"
-#include "aos/common/print_field_helpers.h"
-#include "aos/common/logging/printf_formats.h"
+#include "aos/byteorder.h"
+#include "aos/time/time.h"
+#include "aos/print_field_helpers.h"
+#include "aos/logging/printf_formats.h"
 
 namespace aos {
 
diff --git a/aos/build/queues/queue_primitives.rb b/aos/build/queues/queue_primitives.rb
index 45687ea..a5f6624 100644
--- a/aos/build/queues/queue_primitives.rb
+++ b/aos/build/queues/queue_primitives.rb
@@ -14,7 +14,7 @@
 
 #include <stdint.h>
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 
 namespace aos {
 namespace queue_primitive_types {
diff --git a/aos/common/byteorder.h b/aos/byteorder.h
similarity index 98%
rename from aos/common/byteorder.h
rename to aos/byteorder.h
index ae6ecf4..4a0fd8c 100644
--- a/aos/common/byteorder.h
+++ b/aos/byteorder.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_BYTEORDER_H_
-#define AOS_COMMON_BYTEORDER_H_
+#ifndef AOS_BYTEORDER_H_
+#define AOS_BYTEORDER_H_
 
 #ifndef __VXWORKS__
 #include <endian.h> // endian(3)
diff --git a/aos/common/BUILD b/aos/common/BUILD
deleted file mode 100644
index f9ef264..0000000
--- a/aos/common/BUILD
+++ /dev/null
@@ -1,455 +0,0 @@
-package(default_visibility = ["//visibility:public"])
-
-load("//aos/build:queues.bzl", "queue_library")
-load("//tools:environments.bzl", "mcu_cpus")
-
-queue_library(
-    name = "test_queue",
-    srcs = [
-        "test_queue.q",
-    ],
-)
-
-cc_library(
-    name = "math",
-    hdrs = [
-        "commonmath.h",
-    ],
-    compatible_with = mcu_cpus,
-)
-
-cc_library(
-    name = "macros",
-    hdrs = [
-        "macros.h",
-    ],
-    compatible_with = mcu_cpus + [
-        "//tools:armhf-debian",
-    ],
-)
-
-cc_library(
-    name = "type_traits",
-    hdrs = [
-        "type_traits.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-)
-
-cc_library(
-    name = "time",
-    srcs = [
-        "time.cc",
-    ],
-    hdrs = [
-        "time.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    deps = [
-        ":macros",
-        ":mutex",
-        "//aos/common/logging",
-        "//aos/linux_code/ipc_lib:shared_mem",
-    ],
-)
-
-genrule(
-    name = "gen_queue_primitives",
-    outs = ["queue_primitives.h"],
-    cmd = "$(location //aos/build/queues:queue_primitives) $@",
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    tools = ["//aos/build/queues:queue_primitives"],
-    visibility = ["//visibility:private"],
-)
-
-genrule(
-    name = "gen_print_field",
-    outs = ["print_field.cc"],
-    cmd = "$(location //aos/build/queues:print_field) $@",
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    tools = ["//aos/build/queues:print_field"],
-    visibility = ["//visibility:private"],
-)
-
-cc_library(
-    name = "generated_queue_headers",
-    hdrs = [
-        ":gen_queue_primitives",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    visibility = ["//aos/common/logging:__pkg__"],
-)
-
-cc_library(
-    name = "event",
-    srcs = [
-        "event.cc",
-    ],
-    hdrs = [
-        "event.h",
-    ],
-    deps = [
-        ":time",
-        "//aos/common/logging",
-        "//aos/linux_code/ipc_lib:aos_sync",
-    ],
-)
-
-cc_library(
-    name = "unique_malloc_ptr",
-    hdrs = [
-        "unique_malloc_ptr.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-)
-
-cc_library(
-    name = "queue_types",
-    srcs = [
-        "print_field_helpers.h",
-        "queue_types.cc",
-        ":gen_print_field",
-    ],
-    hdrs = [
-        "queue_types.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    deps = [
-        ":byteorder",
-        ":generated_queue_headers",
-        ":mutex",
-        ":time",
-        "//aos/common/logging:printf_formats",
-        "//aos/linux_code/ipc_lib:core_lib",
-        "//aos/linux_code/ipc_lib:shared_mem",
-    ],
-)
-
-cc_test(
-    name = "queue_types_test",
-    srcs = [
-        "queue_types_test.cc",
-    ],
-    deps = [
-        ":queue_types",
-        ":test_queue",
-        "//aos/common/logging",
-        "//aos/testing:googletest",
-        "//aos/testing:test_logging",
-    ],
-)
-
-cc_library(
-    name = "network_port",
-    hdrs = [
-        "network_port.h",
-    ],
-)
-
-cc_library(
-    name = "byteorder",
-    hdrs = [
-        "byteorder.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-)
-
-cc_library(
-    name = "messages",
-    srcs = [
-        "message.cc",
-    ],
-    hdrs = [
-        "message.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    deps = [
-        ":byteorder",
-        ":macros",
-        ":time",
-    ],
-)
-
-cc_library(
-    name = "queues",
-    hdrs = [
-        "queue.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    deps = [
-        ":messages",
-        "//aos/linux_code:queue",
-        "//aos/linux_code/ipc_lib:queue",
-    ],
-)
-
-cc_library(
-    name = "scoped_fd",
-    hdrs = [
-        "scoped_fd.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    deps = [
-        "//aos/common/logging",
-    ],
-)
-
-cc_test(
-    name = "queue_test",
-    srcs = [
-        "queue_test.cc",
-    ],
-    deps = [
-        ":die",
-        ":test_queue",
-        "//aos/common/util:thread",
-        "//aos/testing:googletest",
-        "//aos/testing:test_shm",
-    ],
-)
-
-cc_test(
-    name = "type_traits_test",
-    srcs = [
-        "type_traits_test.cpp",
-    ],
-    deps = [
-        ":type_traits",
-        "//aos/testing:googletest",
-    ],
-)
-
-cc_library(
-    name = "gtest_prod",
-    hdrs = [
-        "gtest_prod.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-)
-
-cc_test(
-    name = "time_test",
-    srcs = [
-        "time_test.cc",
-    ],
-    deps = [
-        ":time",
-        "//aos/common/logging",
-        "//aos/common/util:death_test_log_implementation",
-        "//aos/testing:googletest",
-    ],
-)
-
-cc_library(
-    name = "die",
-    srcs = [
-        "die.cc",
-    ],
-    hdrs = [
-        "die.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    deps = [
-        ":macros",
-        "//aos/common/libc:aos_strerror",
-    ],
-)
-
-cc_test(
-    name = "mutex_test",
-    srcs = [
-        "mutex_test.cc",
-    ],
-    deps = [
-        ":die",
-        ":mutex",
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/util:death_test_log_implementation",
-        "//aos/common/util:thread",
-        "//aos/testing:googletest",
-        "//aos/testing:test_logging",
-        "//aos/testing:test_shm",
-    ],
-)
-
-cc_test(
-    name = "event_test",
-    srcs = [
-        "event_test.cc",
-    ],
-    deps = [
-        ":event",
-        ":time",
-        "//aos/testing:googletest",
-        "//aos/testing:test_logging",
-    ],
-)
-
-cc_library(
-    name = "condition",
-    srcs = [
-        "condition.cc",
-    ],
-    hdrs = [
-        "condition.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    deps = [
-        ":mutex",
-        "//aos/common/logging",
-        "//aos/linux_code/ipc_lib:aos_sync",
-    ],
-)
-
-cc_test(
-    name = "condition_test",
-    srcs = [
-        "condition_test.cc",
-    ],
-    deps = [
-        ":condition",
-        ":die",
-        ":mutex",
-        ":time",
-        "//aos/common/logging",
-        "//aos/common/util:thread",
-        "//aos/linux_code/ipc_lib:aos_sync",
-        "//aos/linux_code/ipc_lib:core_lib",
-        "//aos/testing:googletest",
-        "//aos/testing:prevent_exit",
-        "//aos/testing:test_shm",
-    ],
-)
-
-cc_test(
-    name = "die_test",
-    srcs = [
-        "die_test.cc",
-    ],
-    deps = [
-        ":die",
-        "//aos/testing:googletest",
-    ],
-)
-
-cc_library(
-    name = "stl_mutex",
-    hdrs = [
-        "stl_mutex.h",
-    ],
-    deps = [
-        "//aos/common/logging",
-        "//aos/linux_code/ipc_lib:aos_sync",
-    ],
-)
-
-cc_library(
-    name = "mutex",
-    srcs = [
-        "mutex.cc",
-    ],
-    hdrs = [
-        "mutex.h",
-    ],
-    compatible_with = [
-        "//tools:armhf-debian",
-    ],
-    deps = [
-        ":die",
-        ":type_traits",
-        "//aos/common/logging",
-        "//aos/linux_code/ipc_lib:aos_sync",
-    ],
-)
-
-cc_test(
-    name = "stl_mutex_test",
-    srcs = [
-        "stl_mutex_test.cc",
-    ],
-    deps = [
-        ":die",
-        ":stl_mutex",
-        "//aos/common/util:thread",
-        "//aos/testing:googletest",
-        "//aos/testing:test_logging",
-    ],
-)
-
-cc_library(
-    name = "transaction",
-    hdrs = [
-        "transaction.h",
-    ],
-    deps = [
-        "//aos/common/logging",
-        "//aos/common/util:compiler_memory_barrier",
-    ],
-)
-
-cc_test(
-    name = "transaction_test",
-    srcs = [
-        "transaction_test.cc",
-    ],
-    deps = [
-        ":transaction",
-        "//aos/common/logging",
-        "//aos/common/util:death_test_log_implementation",
-        "//aos/testing:googletest",
-    ],
-)
-
-cc_library(
-    name = "ring_buffer",
-    hdrs = [
-        "ring_buffer.h",
-    ],
-)
-
-cc_test(
-    name = "ring_buffer_test",
-    srcs = [
-        "ring_buffer_test.cc",
-    ],
-    deps = [
-        ":ring_buffer",
-        "//aos/testing:googletest",
-    ],
-)
-
-py_library(
-    name = "python_init",
-    srcs = ["__init__.py"],
-    visibility = ["//visibility:public"],
-    deps = ["//aos:python_init"],
-)
diff --git a/aos/common/__init__.py b/aos/common/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/aos/common/__init__.py
+++ /dev/null
diff --git a/aos/common/input/BUILD b/aos/common/input/BUILD
deleted file mode 100644
index 2539f55..0000000
--- a/aos/common/input/BUILD
+++ /dev/null
@@ -1,14 +0,0 @@
-package(default_visibility = ['//visibility:public'])
-
-cc_library(
-  name = 'driver_station_data',
-  srcs = [
-    'driver_station_data.cc',
-  ],
-  hdrs = [
-    'driver_station_data.h',
-  ],
-  deps = [
-    '//aos/common/messages:robot_state',
-  ],
-)
diff --git a/aos/common/logging/sizes.h b/aos/common/logging/sizes.h
deleted file mode 100644
index 0aae90b..0000000
--- a/aos/common/logging/sizes.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef AOS_COMMON_LOGGING_SIZES_H_
-#define AOS_COMMON_LOGGING_SIZES_H_
-
-// This file exists so C code and context.h can both get at these constants...
-
-#define LOG_MESSAGE_LEN 500
-#define LOG_MESSAGE_NAME_LEN 100
-
-#endif  // AOS_COMMON_LOGGING_SIZES_H_
diff --git a/aos/common/commonmath.h b/aos/commonmath.h
similarity index 91%
rename from aos/common/commonmath.h
rename to aos/commonmath.h
index acbcb1c..0130992 100644
--- a/aos/common/commonmath.h
+++ b/aos/commonmath.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_MATH_H_
-#define AOS_COMMON_MATH_H_
+#ifndef AOS_MATH_H_
+#define AOS_MATH_H_
 
 #include <cmath>
 
@@ -40,4 +40,4 @@
 }
 }  // namespace aos
 
-#endif  // AOS_COMMON_MATH_H_
+#endif  // AOS_MATH_H_
diff --git a/aos/common/condition.cc b/aos/condition.cc
similarity index 83%
rename from aos/common/condition.cc
rename to aos/condition.cc
index 62ede1c..d1ad3a9 100644
--- a/aos/common/condition.cc
+++ b/aos/condition.cc
@@ -1,10 +1,10 @@
-#include "aos/common/condition.h"
+#include "aos/condition.h"
 
 #include <inttypes.h>
 #include <assert.h>
 
-#include "aos/common/type_traits.h"
-#include "aos/common/mutex.h"
+#include "aos/type_traits/type_traits.h"
+#include "aos/mutex/mutex.h"
 
 namespace aos {
 
diff --git a/aos/common/condition.h b/aos/condition.h
similarity index 96%
rename from aos/common/condition.h
rename to aos/condition.h
index 84f0542..d846ab1 100644
--- a/aos/common/condition.h
+++ b/aos/condition.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_CONDITION_H_
-#define AOS_COMMON_CONDITION_H_
+#ifndef AOS_CONDITION_H_
+#define AOS_CONDITION_H_
 
 #include "aos/linux_code/ipc_lib/aos_sync.h"
 
@@ -80,4 +80,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_CONDITION_H_
+#endif  // AOS_CONDITION_H_
diff --git a/aos/common/condition_test.cc b/aos/condition_test.cc
similarity index 97%
rename from aos/common/condition_test.cc
rename to aos/condition_test.cc
index f8e4e65..15b948e 100644
--- a/aos/common/condition_test.cc
+++ b/aos/condition_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/condition.h"
+#include "aos/condition.h"
 
 #include <unistd.h>
 #include <sys/types.h>
@@ -10,16 +10,16 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/time.h"
-#include "aos/common/mutex.h"
+#include "aos/time/time.h"
+#include "aos/mutex/mutex.h"
 #include "aos/testing/test_shm.h"
-#include "aos/common/type_traits.h"
+#include "aos/type_traits/type_traits.h"
 #include "aos/linux_code/ipc_lib/core_lib.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/macros.h"
+#include "aos/logging/logging.h"
+#include "aos/macros.h"
 #include "aos/linux_code/ipc_lib/aos_sync.h"
-#include "aos/common/die.h"
-#include "aos/common/util/thread.h"
+#include "aos/die.h"
+#include "aos/util/thread.h"
 #include "aos/testing/prevent_exit.h"
 
 namespace aos {
diff --git a/aos/common/controls/BUILD b/aos/controls/BUILD
similarity index 73%
rename from aos/common/controls/BUILD
rename to aos/controls/BUILD
index 7ca2e60..d529f04 100644
--- a/aos/common/controls/BUILD
+++ b/aos/controls/BUILD
@@ -10,10 +10,10 @@
     ],
     deps = [
         ":control_loop",
-        "//aos/common:queues",
-        "//aos/common:time",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/logging:replay",
+        "//aos:queues",
+        "//aos/time:time",
+        "//aos/logging:queue_logging",
+        "//aos/logging:replay",
     ],
 )
 
@@ -27,9 +27,9 @@
         "control_loop_test.h",
     ],
     deps = [
-        "//aos/common:time",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
+        "//aos/time:time",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
         "//aos/testing:googletest",
         "//aos/testing:test_shm",
     ],
@@ -52,8 +52,8 @@
         "polytope.h",
     ],
     deps = [
-        "//aos/common/logging",
-        "//aos/common/logging:matrix_logging",
+        "//aos/logging",
+        "//aos/logging:matrix_logging",
         "//third_party/cddlib",
         "//third_party/eigen",
     ],
@@ -94,11 +94,11 @@
     ],
     deps = [
         ":control_loop_queues",
-        "//aos/common:queues",
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
+        "//aos:queues",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
     ],
 )
diff --git a/aos/common/controls/control_loop-tmpl.h b/aos/controls/control_loop-tmpl.h
similarity index 95%
rename from aos/common/controls/control_loop-tmpl.h
rename to aos/controls/control_loop-tmpl.h
index b2f85e7..1834728 100644
--- a/aos/common/controls/control_loop-tmpl.h
+++ b/aos/controls/control_loop-tmpl.h
@@ -1,9 +1,9 @@
 #include <stddef.h>
 #include <inttypes.h>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/messages/robot_state.q.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/robot_state/robot_state.q.h"
 
 namespace aos {
 namespace controls {
diff --git a/aos/common/controls/control_loop.cc b/aos/controls/control_loop.cc
similarity index 64%
rename from aos/common/controls/control_loop.cc
rename to aos/controls/control_loop.cc
index c314254..17e5d7e 100644
--- a/aos/common/controls/control_loop.cc
+++ b/aos/controls/control_loop.cc
@@ -1,4 +1,4 @@
-#include "aos/common/controls/control_loop.h"
+#include "aos/controls/control_loop.h"
 
 namespace aos {
 namespace controls {
diff --git a/aos/common/controls/control_loop.h b/aos/controls/control_loop.h
similarity index 96%
rename from aos/common/controls/control_loop.h
rename to aos/controls/control_loop.h
index 70e87f8..fd63e3f 100644
--- a/aos/common/controls/control_loop.h
+++ b/aos/controls/control_loop.h
@@ -4,10 +4,10 @@
 #include <string.h>
 #include <atomic>
 
-#include "aos/common/queue.h"
-#include "aos/common/time.h"
-#include "aos/common/type_traits.h"
-#include "aos/common/util/log_interval.h"
+#include "aos/queue.h"
+#include "aos/time/time.h"
+#include "aos/type_traits/type_traits.h"
+#include "aos/util/log_interval.h"
 
 namespace aos {
 namespace controls {
@@ -172,6 +172,6 @@
 }  // namespace controls
 }  // namespace aos
 
-#include "aos/common/controls/control_loop-tmpl.h"  // IWYU pragma: export
+#include "aos/controls/control_loop-tmpl.h"  // IWYU pragma: export
 
 #endif
diff --git a/aos/common/controls/control_loop_test.cc b/aos/controls/control_loop_test.cc
similarity index 90%
rename from aos/common/controls/control_loop_test.cc
rename to aos/controls/control_loop_test.cc
index 4e29062..61c2fe0 100644
--- a/aos/common/controls/control_loop_test.cc
+++ b/aos/controls/control_loop_test.cc
@@ -1,7 +1,7 @@
-#include "aos/common/controls/control_loop_test.h"
+#include "aos/controls/control_loop_test.h"
 
-#include "aos/common/messages/robot_state.q.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/robot_state/robot_state.q.h"
+#include "aos/logging/queue_logging.h"
 
 namespace aos {
 namespace testing {
diff --git a/aos/common/controls/control_loop_test.h b/aos/controls/control_loop_test.h
similarity index 90%
rename from aos/common/controls/control_loop_test.h
rename to aos/controls/control_loop_test.h
index 6fae706..1633daf 100644
--- a/aos/common/controls/control_loop_test.h
+++ b/aos/controls/control_loop_test.h
@@ -1,10 +1,10 @@
-#ifndef AOS_COMMON_CONTROLS_CONTROL_LOOP_TEST_H_
-#define AOS_COMMON_CONTROLS_CONTROL_LOOP_TEST_H_
+#ifndef AOS_CONTROLS_CONTROL_LOOP_TEST_H_
+#define AOS_CONTROLS_CONTROL_LOOP_TEST_H_
 
 #include "gtest/gtest.h"
 
 #include "aos/testing/test_shm.h"
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 
 namespace aos {
 namespace testing {
@@ -67,4 +67,4 @@
 }  // namespace testing
 }  // namespace aos
 
-#endif  // AOS_COMMON_CONTROLS_CONTROL_LOOP_TEST_H_
+#endif  // AOS_CONTROLS_CONTROL_LOOP_TEST_H_
diff --git a/aos/common/controls/control_loops.q b/aos/controls/control_loops.q
similarity index 100%
rename from aos/common/controls/control_loops.q
rename to aos/controls/control_loops.q
diff --git a/aos/common/controls/polytope.h b/aos/controls/polytope.h
similarity index 97%
rename from aos/common/controls/polytope.h
rename to aos/controls/polytope.h
index 03d8fcd..145b904 100644
--- a/aos/common/controls/polytope.h
+++ b/aos/controls/polytope.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_CONTROLS_POLYTOPE_H_
-#define AOS_COMMON_CONTROLS_POLYTOPE_H_
+#ifndef AOS_CONTROLS_POLYTOPE_H_
+#define AOS_CONTROLS_POLYTOPE_H_
 
 #include "Eigen/Dense"
 
@@ -7,8 +7,8 @@
 #include "third_party/cddlib/lib-src/setoper.h"
 #include "third_party/cddlib/lib-src/cdd.h"
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/matrix_logging.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/matrix_logging.h"
 #endif  // __linux__
 
 namespace aos {
@@ -234,4 +234,4 @@
 }  // namespace controls
 }  // namespace aos
 
-#endif  // AOS_COMMON_CONTROLS_POLYTOPE_H_
+#endif  // AOS_CONTROLS_POLYTOPE_H_
diff --git a/aos/common/controls/polytope_test.cc b/aos/controls/polytope_test.cc
similarity index 98%
rename from aos/common/controls/polytope_test.cc
rename to aos/controls/polytope_test.cc
index a43b056..d7ec5e5 100644
--- a/aos/common/controls/polytope_test.cc
+++ b/aos/controls/polytope_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/controls/polytope.h"
+#include "aos/controls/polytope.h"
 
 #include <vector>
 
diff --git a/aos/common/controls/replay_control_loop.h b/aos/controls/replay_control_loop.h
similarity index 94%
rename from aos/common/controls/replay_control_loop.h
rename to aos/controls/replay_control_loop.h
index 6921a0e..d1436dd 100644
--- a/aos/common/controls/replay_control_loop.h
+++ b/aos/controls/replay_control_loop.h
@@ -1,14 +1,14 @@
-#ifndef AOS_COMMON_CONTROLS_REPLAY_CONTROL_LOOP_H_
-#define AOS_COMMON_CONTROLS_REPLAY_CONTROL_LOOP_H_
+#ifndef AOS_CONTROLS_REPLAY_CONTROL_LOOP_H_
+#define AOS_CONTROLS_REPLAY_CONTROL_LOOP_H_
 
 #include <fcntl.h>
 
-#include "aos/common/queue.h"
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/logging/replay.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/time.h"
-#include "aos/common/macros.h"
+#include "aos/queue.h"
+#include "aos/controls/control_loop.h"
+#include "aos/logging/replay.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/time/time.h"
+#include "aos/macros.h"
 
 namespace aos {
 namespace controls {
@@ -189,4 +189,4 @@
 }  // namespace controls
 }  // namespace aos
 
-#endif  // AOS_COMMON_CONTROLS_REPLAY_CONTROL_LOOP_H_
+#endif  // AOS_CONTROLS_REPLAY_CONTROL_LOOP_H_
diff --git a/aos/common/debugging-tips.txt b/aos/debugging-tips.txt
similarity index 100%
rename from aos/common/debugging-tips.txt
rename to aos/debugging-tips.txt
diff --git a/aos/common/die.cc b/aos/die.cc
similarity index 98%
rename from aos/common/die.cc
rename to aos/die.cc
index 69b2aef..ad5f2a8 100644
--- a/aos/common/die.cc
+++ b/aos/die.cc
@@ -1,4 +1,4 @@
-#include "aos/common/die.h"
+#include "aos/die.h"
 
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/aos/common/die.h b/aos/die.h
similarity index 91%
rename from aos/common/die.h
rename to aos/die.h
index f9ff457..4296881 100644
--- a/aos/common/die.h
+++ b/aos/die.h
@@ -1,10 +1,10 @@
-#ifndef AOS_COMMON_DIE_H_
-#define AOS_COMMON_DIE_H_
+#ifndef AOS_DIE_H_
+#define AOS_DIE_H_
 
 #include <stdarg.h>
 
-#include "aos/common/macros.h"
-#include "aos/common/libc/aos_strerror.h"
+#include "aos/macros.h"
+#include "aos/libc/aos_strerror.h"
 
 namespace aos {
 
@@ -48,4 +48,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_DIE_H_
+#endif  // AOS_DIE_H_
diff --git a/aos/common/die_test.cc b/aos/die_test.cc
similarity index 89%
rename from aos/common/die_test.cc
rename to aos/die_test.cc
index 687543c..8c0a703 100644
--- a/aos/common/die_test.cc
+++ b/aos/die_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/die.h"
+#include "aos/die.h"
 
 #include "gtest/gtest.h"
 
diff --git a/aos/common/event.cc b/aos/event.cc
similarity index 92%
rename from aos/common/event.cc
rename to aos/event.cc
index ffb62b4..dd43dc8 100644
--- a/aos/common/event.cc
+++ b/aos/event.cc
@@ -1,9 +1,9 @@
-#include "aos/common/event.h"
+#include "aos/event.h"
 
 #include <chrono>
 
-#include "aos/common/type_traits.h"
-#include "aos/common/logging/logging.h"
+#include "aos/type_traits/type_traits.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 
diff --git a/aos/common/event.h b/aos/event.h
similarity index 94%
rename from aos/common/event.h
rename to aos/event.h
index 559aad5..c2ad1bc 100644
--- a/aos/common/event.h
+++ b/aos/event.h
@@ -1,7 +1,7 @@
-#ifndef AOS_COMMON_EVENT_H_
-#define AOS_COMMON_EVENT_H_
+#ifndef AOS_EVENT_H_
+#define AOS_EVENT_H_
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 
 #include "aos/linux_code/ipc_lib/aos_sync.h"
 
@@ -57,4 +57,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_EVENT_H_
+#endif  // AOS_EVENT_H_
diff --git a/aos/common/event_test.cc b/aos/event_test.cc
similarity index 97%
rename from aos/common/event_test.cc
rename to aos/event_test.cc
index 764dd49..7fe573d 100644
--- a/aos/common/event_test.cc
+++ b/aos/event_test.cc
@@ -1,11 +1,11 @@
-#include "aos/common/event.h"
+#include "aos/event.h"
 
 #include <chrono>
 #include <thread>
 
 #include "gtest/gtest.h"
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 #include "aos/testing/test_logging.h"
 
 namespace aos {
diff --git a/aos/events/BUILD b/aos/events/BUILD
index d2108a8..ad888f6 100644
--- a/aos/events/BUILD
+++ b/aos/events/BUILD
@@ -3,8 +3,8 @@
   name = "raw-event-loop",
   hdrs = ["raw-event-loop.h"],
   deps = [
-    "//aos/common:time",
-    "//aos/common:queues",
+    "//aos/time:time",
+    "//aos:queues",
   ],
 )
 
@@ -14,8 +14,8 @@
   srcs = ["event-loop-tmpl.h"],
   deps = [
     ":raw-event-loop",
-    "//aos/common:time",
-    "//aos/common:queues",
+    "//aos/time:time",
+    "//aos:queues",
   ],
 )
 
@@ -25,8 +25,8 @@
   srcs = ["shm-event-loop.cc"],
   deps = [
     ":event-loop",
-    "//aos/common:queues",
-    "//aos/common/logging:logging",
+    "//aos:queues",
+    "//aos/logging:logging",
   ],
 )
 
@@ -68,7 +68,7 @@
   srcs = ["simulated-event-loop.cc"],
   deps = [
     ":event-loop",
-    "//aos/common:queues",
+    "//aos:queues",
   ],
 )
 
diff --git a/aos/events/event-loop.h b/aos/events/event-loop.h
index d3cbf3f..57ff49b 100644
--- a/aos/events/event-loop.h
+++ b/aos/events/event-loop.h
@@ -2,8 +2,8 @@
 #define _AOS_EVENTS_EVENT_LOOP_H_
 
 #include <string>
-#include "aos/common/queue.h"
-#include "aos/common/time.h"
+#include "aos/queue.h"
+#include "aos/time/time.h"
 #include "aos/events/raw-event-loop.h"
 
 namespace aos {
diff --git a/aos/events/raw-event-loop.h b/aos/events/raw-event-loop.h
index 9b1408d..ffc894b 100644
--- a/aos/events/raw-event-loop.h
+++ b/aos/events/raw-event-loop.h
@@ -4,8 +4,8 @@
 #include <atomic>
 #include <memory>
 #include <string>
-#include "aos/common/queue.h"
-#include "aos/common/time.h"
+#include "aos/queue.h"
+#include "aos/time/time.h"
 
 // This file contains raw versions of the classes in event-loop.h.
 //
diff --git a/aos/events/shm-event-loop.cc b/aos/events/shm-event-loop.cc
index 832b27b..6231df2 100644
--- a/aos/events/shm-event-loop.cc
+++ b/aos/events/shm-event-loop.cc
@@ -1,6 +1,6 @@
 #include "aos/events/shm-event-loop.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/queue.h"
+#include "aos/logging/logging.h"
+#include "aos/queue.h"
 
 #include <sys/timerfd.h>
 #include <atomic>
diff --git a/aos/events/shm-event-loop.h b/aos/events/shm-event-loop.h
index 3b36f40..9bbdb42 100644
--- a/aos/events/shm-event-loop.h
+++ b/aos/events/shm-event-loop.h
@@ -1,7 +1,7 @@
 #include <unordered_set>
 #include <vector>
-#include "aos/common/condition.h"
-#include "aos/common/mutex.h"
+#include "aos/condition.h"
+#include "aos/mutex/mutex.h"
 #include "aos/events/event-loop.h"
 
 namespace aos {
@@ -13,7 +13,7 @@
 }  // namespace internal
 
 // Specialization of EventLoop that is built from queues running out of shared
-// memory. See more details at aos/common/queue.h
+// memory. See more details at aos/queue.h
 class ShmEventLoop : public EventLoop {
  public:
   ShmEventLoop();
diff --git a/aos/events/simulated-event-loop.cc b/aos/events/simulated-event-loop.cc
index 90b78cd..efce9ab 100644
--- a/aos/events/simulated-event-loop.cc
+++ b/aos/events/simulated-event-loop.cc
@@ -1,5 +1,5 @@
 #include "aos/events/simulated-event-loop.h"
-#include "aos/common/queue.h"
+#include "aos/queue.h"
 
 namespace aos {
 namespace {
diff --git a/aos/common/gtest_prod.h b/aos/gtest_prod.h
similarity index 90%
rename from aos/common/gtest_prod.h
rename to aos/gtest_prod.h
index 6c7d96e..3050ae7 100644
--- a/aos/common/gtest_prod.h
+++ b/aos/gtest_prod.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_GTEST_PROD_H_
-#define AOS_COMMON_GTEST_PROD_H_
+#ifndef AOS_GTEST_PROD_H_
+#define AOS_GTEST_PROD_H_
 
 // These macros replace gtest's FRIEND_TEST if the test is in a different
 // namespace than the code that needs to make it a friend.
@@ -36,4 +36,4 @@
 #define FRIEND_TEST(test_case_name, test_name) \
   friend class test_case_name##_##test_name##_Test
 
-#endif  // AOS_COMMON_GTEST_PROD_H_
+#endif  // AOS_GTEST_PROD_H_
diff --git a/aos/input/BUILD b/aos/input/BUILD
index b3c5b53..f27bf98 100644
--- a/aos/input/BUILD
+++ b/aos/input/BUILD
@@ -9,10 +9,10 @@
     'joystick_input.h',
   ],
   deps = [
-    '//aos/common/input:driver_station_data',
-    '//aos/common/messages:robot_state',
-    '//aos/common/logging',
-    '//aos/common/logging:queue_logging',
+    '//aos/input:driver_station_data',
+    '//aos/robot_state:robot_state',
+    '//aos/logging',
+    '//aos/logging:queue_logging',
   ],
 )
 
@@ -25,12 +25,25 @@
     'drivetrain_input.h',
   ],
   deps = [
-    '//aos/common/input:driver_station_data',
-    '//aos/common/logging',
-    '//aos/common/logging:queue_logging',
-    '//aos/common/messages:robot_state',
-    '//aos/common:math',
+    '//aos/input:driver_station_data',
+    '//aos/logging',
+    '//aos/logging:queue_logging',
+    '//aos/robot_state:robot_state',
+    '//aos:math',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
     '//frc971/control_loops/drivetrain:drivetrain_config',
   ],
 )
+
+cc_library(
+  name = 'driver_station_data',
+  srcs = [
+    'driver_station_data.cc',
+  ],
+  hdrs = [
+    'driver_station_data.h',
+  ],
+  deps = [
+    '//aos/robot_state:robot_state',
+  ],
+)
diff --git a/aos/common/input/driver_station_data.cc b/aos/input/driver_station_data.cc
similarity index 97%
rename from aos/common/input/driver_station_data.cc
rename to aos/input/driver_station_data.cc
index 2df98be..75d9149 100644
--- a/aos/common/input/driver_station_data.cc
+++ b/aos/input/driver_station_data.cc
@@ -1,4 +1,4 @@
-#include "aos/common/input/driver_station_data.h"
+#include "aos/input/driver_station_data.h"
 
 namespace aos {
 namespace input {
diff --git a/aos/common/input/driver_station_data.h b/aos/input/driver_station_data.h
similarity index 93%
rename from aos/common/input/driver_station_data.h
rename to aos/input/driver_station_data.h
index 874b90c..6a52248 100644
--- a/aos/common/input/driver_station_data.h
+++ b/aos/input/driver_station_data.h
@@ -1,12 +1,12 @@
-#ifndef AOS_COMMON_INPUT_DRIVER_STATION_DATA_H_
-#define AOS_COMMON_INPUT_DRIVER_STATION_DATA_H_
+#ifndef AOS_INPUT_DRIVER_STATION_DATA_H_
+#define AOS_INPUT_DRIVER_STATION_DATA_H_
 
 // This file defines several types to support nicely looking at the data
 // received from the driver's station.
 
 #include <memory>
 
-#include "aos/common/messages/robot_state.q.h"
+#include "aos/robot_state/robot_state.q.h"
 
 namespace aos {
 namespace input {
@@ -108,4 +108,4 @@
 }  // namespace input
 }  // namespace aos
 
-#endif  // AOS_COMMON_INPUT_DRIVER_STATION_DATA_H_
+#endif  // AOS_INPUT_DRIVER_STATION_DATA_H_
diff --git a/aos/input/drivetrain_input.cc b/aos/input/drivetrain_input.cc
index 852b94e..23bb8c1 100644
--- a/aos/input/drivetrain_input.cc
+++ b/aos/input/drivetrain_input.cc
@@ -5,9 +5,9 @@
 #include <string.h>
 #include <cmath>
 
-#include "aos/common/commonmath.h"
-#include "aos/common/input/driver_station_data.h"
-#include "aos/common/logging/logging.h"
+#include "aos/commonmath.h"
+#include "aos/input/driver_station_data.h"
+#include "aos/logging/logging.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 
 using ::frc971::control_loops::drivetrain_queue;
diff --git a/aos/input/drivetrain_input.h b/aos/input/drivetrain_input.h
index e38320c..5274cfa 100644
--- a/aos/input/drivetrain_input.h
+++ b/aos/input/drivetrain_input.h
@@ -7,8 +7,8 @@
 #include <cmath>
 #include <memory>
 
-#include "aos/common/input/driver_station_data.h"
-#include "aos/common/logging/logging.h"
+#include "aos/input/driver_station_data.h"
+#include "aos/logging/logging.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain_config.h"
 
diff --git a/aos/input/joystick_input.cc b/aos/input/joystick_input.cc
index 7508c3c..1620fdb 100644
--- a/aos/input/joystick_input.cc
+++ b/aos/input/joystick_input.cc
@@ -3,9 +3,9 @@
 #include <string.h>
 #include <atomic>
 
-#include "aos/common/messages/robot_state.q.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/robot_state/robot_state.q.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
 
 namespace aos {
 namespace input {
diff --git a/aos/input/joystick_input.h b/aos/input/joystick_input.h
index b10b1ba..4b5c5a6 100644
--- a/aos/input/joystick_input.h
+++ b/aos/input/joystick_input.h
@@ -3,7 +3,7 @@
 
 #include <atomic>
 
-#include "aos/common/input/driver_station_data.h"
+#include "aos/input/driver_station_data.h"
 
 namespace aos {
 namespace input {
diff --git a/aos/common/libc/BUILD b/aos/libc/BUILD
similarity index 93%
rename from aos/common/libc/BUILD
rename to aos/libc/BUILD
index 74a4c70..c2fb6ab 100644
--- a/aos/common/libc/BUILD
+++ b/aos/libc/BUILD
@@ -9,7 +9,7 @@
         "aos_strsignal.h",
     ],
     deps = [
-        "//aos/common/logging",
+        "//aos/logging",
     ],
 )
 
@@ -20,7 +20,7 @@
     ],
     deps = [
         ":aos_strsignal",
-        "//aos/common/logging",
+        "//aos/logging",
         "//aos/testing:googletest",
     ],
 )
diff --git a/aos/common/libc/README b/aos/libc/README
similarity index 100%
rename from aos/common/libc/README
rename to aos/libc/README
diff --git a/aos/common/libc/aos_strerror.cc b/aos/libc/aos_strerror.cc
similarity index 96%
rename from aos/common/libc/aos_strerror.cc
rename to aos/libc/aos_strerror.cc
index c91fd00..1353242 100644
--- a/aos/common/libc/aos_strerror.cc
+++ b/aos/libc/aos_strerror.cc
@@ -1,4 +1,4 @@
-#include "aos/common/libc/aos_strerror.h"
+#include "aos/libc/aos_strerror.h"
 
 #include <assert.h>
 #include <sys/types.h>
diff --git a/aos/common/libc/aos_strerror.h b/aos/libc/aos_strerror.h
similarity index 82%
rename from aos/common/libc/aos_strerror.h
rename to aos/libc/aos_strerror.h
index acce427..cce4502 100644
--- a/aos/common/libc/aos_strerror.h
+++ b/aos/libc/aos_strerror.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_LIBC_AOS_STRERROR_H_
-#define AOS_COMMON_LIBC_AOS_STRERROR_H_
+#ifndef AOS_LIBC_AOS_STRERROR_H_
+#define AOS_LIBC_AOS_STRERROR_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -20,4 +20,4 @@
 }
 #endif
 
-#endif  // AOS_COMMON_LIBC_AOS_STRERROR_H_
+#endif  // AOS_LIBC_AOS_STRERROR_H_
diff --git a/aos/common/libc/aos_strerror_test.cc b/aos/libc/aos_strerror_test.cc
similarity index 93%
rename from aos/common/libc/aos_strerror_test.cc
rename to aos/libc/aos_strerror_test.cc
index c4574fe..65781bc 100644
--- a/aos/common/libc/aos_strerror_test.cc
+++ b/aos/libc/aos_strerror_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/libc/aos_strerror.h"
+#include "aos/libc/aos_strerror.h"
 
 #include <errno.h>
 
diff --git a/aos/common/libc/aos_strsignal.cc b/aos/libc/aos_strsignal.cc
similarity index 85%
rename from aos/common/libc/aos_strsignal.cc
rename to aos/libc/aos_strsignal.cc
index 2321a07..77f0b90 100644
--- a/aos/common/libc/aos_strsignal.cc
+++ b/aos/libc/aos_strsignal.cc
@@ -1,8 +1,8 @@
-#include "aos/common/libc/aos_strsignal.h"
+#include "aos/libc/aos_strsignal.h"
 
 #include <signal.h>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 const char *aos_strsignal(int signal) {
   static thread_local char buffer[512];
diff --git a/aos/common/libc/aos_strsignal.h b/aos/libc/aos_strsignal.h
similarity index 66%
rename from aos/common/libc/aos_strsignal.h
rename to aos/libc/aos_strsignal.h
index ef6795c..9b33df3 100644
--- a/aos/common/libc/aos_strsignal.h
+++ b/aos/libc/aos_strsignal.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_LIBC_AOS_STRSIGNAL_H_
-#define AOS_COMMON_LIBC_AOS_STRSIGNAL_H_
+#ifndef AOS_LIBC_AOS_STRSIGNAL_H_
+#define AOS_LIBC_AOS_STRSIGNAL_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -14,4 +14,4 @@
 }
 #endif
 
-#endif  // AOS_COMMON_LIBC_AOS_STRSIGNAL_H_
+#endif  // AOS_LIBC_AOS_STRSIGNAL_H_
diff --git a/aos/common/libc/aos_strsignal_test.cc b/aos/libc/aos_strsignal_test.cc
similarity index 96%
rename from aos/common/libc/aos_strsignal_test.cc
rename to aos/libc/aos_strsignal_test.cc
index 3d90b21..7520985 100644
--- a/aos/common/libc/aos_strsignal_test.cc
+++ b/aos/libc/aos_strsignal_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/libc/aos_strsignal.h"
+#include "aos/libc/aos_strsignal.h"
 
 #include <signal.h>
 #include <thread>
diff --git a/aos/common/libc/dirname.cc b/aos/libc/dirname.cc
similarity index 95%
rename from aos/common/libc/dirname.cc
rename to aos/libc/dirname.cc
index c843898..bc34496 100644
--- a/aos/common/libc/dirname.cc
+++ b/aos/libc/dirname.cc
@@ -1,4 +1,4 @@
-#include "aos/common/libc/dirname.h"
+#include "aos/libc/dirname.h"
 
 namespace aos {
 namespace libc {
diff --git a/aos/common/libc/dirname.h b/aos/libc/dirname.h
similarity index 63%
rename from aos/common/libc/dirname.h
rename to aos/libc/dirname.h
index f05f8f1..fa733d7 100644
--- a/aos/common/libc/dirname.h
+++ b/aos/libc/dirname.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_LIBC_DIRNAME_H_
-#define AOS_COMMON_LIBC_DIRNAME_H_
+#ifndef AOS_LIBC_DIRNAME_H_
+#define AOS_LIBC_DIRNAME_H_
 
 #include <string>
 
@@ -12,4 +12,4 @@
 }  // namespace libc
 }  // namespace aos
 
-#endif  // AOS_COMMON_LIBC_DIRNAME_H_
+#endif  // AOS_LIBC_DIRNAME_H_
diff --git a/aos/common/libc/dirname_test.cc b/aos/libc/dirname_test.cc
similarity index 98%
rename from aos/common/libc/dirname_test.cc
rename to aos/libc/dirname_test.cc
index 0207961..d003936 100644
--- a/aos/common/libc/dirname_test.cc
+++ b/aos/libc/dirname_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/libc/dirname.h"
+#include "aos/libc/dirname.h"
 
 #include <libgen.h>
 
diff --git a/aos/linux_code/BUILD b/aos/linux_code/BUILD
index b572a25..7cc22d0 100644
--- a/aos/linux_code/BUILD
+++ b/aos/linux_code/BUILD
@@ -6,9 +6,9 @@
         "dump_rtprio.cc",
     ],
     deps = [
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/logging:implementations",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/logging:implementations",
     ],
 )
 
@@ -20,7 +20,7 @@
     compatible_with = [
         "//tools:armhf-debian",
     ],
-    visibility = ["//aos/common:__pkg__"],
+    visibility = ["//aos:__pkg__"],
 )
 
 cc_library(
@@ -39,7 +39,7 @@
     ],
     deps = [
         "//aos:once",
-        "//aos/common:die",
+        "//aos:die",
     ],
 )
 
@@ -50,8 +50,8 @@
     ],
     deps = [
         ":complex_thread_local",
-        "//aos/common/logging",
-        "//aos/common/util:thread",
+        "//aos/logging",
+        "//aos/util:thread",
         "//aos/testing:googletest",
     ],
 )
@@ -68,8 +68,8 @@
         "//tools:armhf-debian",
     ],
     deps = [
-        "//aos/common:die",
-        "//aos/common/logging:implementations",
+        "//aos:die",
+        "//aos/logging:implementations",
         "//aos/linux_code/ipc_lib:shared_mem",
     ],
 )
@@ -87,8 +87,8 @@
     ],
     deps = [
         "//aos:once",
-        "//aos/common:unique_malloc_ptr",
-        "//aos/common/logging",
+        "//aos:unique_malloc_ptr",
+        "//aos/logging",
     ],
 )
 
@@ -99,6 +99,6 @@
     ],
     deps = [
         ":init",
-        "//aos/common/util:run_command",
+        "//aos/util:run_command",
     ],
 )
diff --git a/aos/linux_code/complex_thread_local.cc b/aos/linux_code/complex_thread_local.cc
index f5ddc9c..fbfe914 100644
--- a/aos/linux_code/complex_thread_local.cc
+++ b/aos/linux_code/complex_thread_local.cc
@@ -2,7 +2,7 @@
 
 #include <pthread.h>
 
-#include "aos/common/die.h"
+#include "aos/die.h"
 #include "aos/once.h"
 
 #define SIMPLE_CHECK(call)              \
diff --git a/aos/linux_code/complex_thread_local_test.cc b/aos/linux_code/complex_thread_local_test.cc
index 97f0568..6163ba7 100644
--- a/aos/linux_code/complex_thread_local_test.cc
+++ b/aos/linux_code/complex_thread_local_test.cc
@@ -4,7 +4,7 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/util/thread.h"
+#include "aos/util/thread.h"
 
 namespace aos {
 namespace testing {
diff --git a/aos/linux_code/configuration.cc b/aos/linux_code/configuration.cc
index 0536e25..76e744f 100644
--- a/aos/linux_code/configuration.cc
+++ b/aos/linux_code/configuration.cc
@@ -8,8 +8,8 @@
 #include <ifaddrs.h>
 #include <unistd.h>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/unique_malloc_ptr.h"
+#include "aos/logging/logging.h"
+#include "aos/unique_malloc_ptr.h"
 #include "aos/once.h"
 
 namespace aos {
diff --git a/aos/linux_code/core.cc b/aos/linux_code/core.cc
index 189df1d..3aab562 100644
--- a/aos/linux_code/core.cc
+++ b/aos/linux_code/core.cc
@@ -8,7 +8,7 @@
 #include <string>
 
 #include "aos/linux_code/init.h"
-#include "aos/common/util/run_command.h"
+#include "aos/util/run_command.h"
 
 // Initializes shared memory. This is the only file that will create the shared
 // memory file if it doesn't already exist (and set everything up).
diff --git a/aos/linux_code/dump_rtprio.cc b/aos/linux_code/dump_rtprio.cc
index 2bfb9c1..2b821cf 100644
--- a/aos/linux_code/dump_rtprio.cc
+++ b/aos/linux_code/dump_rtprio.cc
@@ -16,9 +16,9 @@
 
 #include <string>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/implementations.h"
-#include "aos/common/time.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/implementations.h"
+#include "aos/time/time.h"
 
 namespace {
 
diff --git a/aos/linux_code/init.cc b/aos/linux_code/init.cc
index ce557e4..c5a2285 100644
--- a/aos/linux_code/init.cc
+++ b/aos/linux_code/init.cc
@@ -13,8 +13,8 @@
 #include <sys/prctl.h>
 #include <malloc.h>
 
-#include "aos/common/die.h"
-#include "aos/common/logging/implementations.h"
+#include "aos/die.h"
+#include "aos/logging/implementations.h"
 #include "aos/linux_code/ipc_lib/shared_mem.h"
 
 namespace FLAG__namespace_do_not_use_directly_use_DECLARE_double_instead {
@@ -27,7 +27,7 @@
 namespace logging {
 namespace internal {
 
-// Implemented in aos/common/logging/context.cc.
+// Implemented in aos/logging/context.cc.
 void ReloadThreadName();
 
 }  // namespace internal
diff --git a/aos/linux_code/ipc_lib/BUILD b/aos/linux_code/ipc_lib/BUILD
index 289bde8..d550a65 100644
--- a/aos/linux_code/ipc_lib/BUILD
+++ b/aos/linux_code/ipc_lib/BUILD
@@ -16,9 +16,9 @@
     ],
     deps = [
         "//aos:once",
-        "//aos/common:macros",
-        "//aos/common/logging",
-        "//aos/common/util:compiler_memory_barrier",
+        "//aos:macros",
+        "//aos/logging",
+        "//aos/util:compiler_memory_barrier",
     ],
 )
 
@@ -57,7 +57,7 @@
         ":aos_sync",
         ":core_lib",
         ":shared_mem_types",
-        "//aos/common/logging",
+        "//aos/logging",
     ],
 )
 
@@ -93,10 +93,10 @@
     deps = [
         ":core_lib",
         ":shared_mem",
-        "//aos/common:condition",
-        "//aos/common:mutex",
-        "//aos/common/logging",
-        "//aos/common/util:options",
+        "//aos:condition",
+        "//aos/mutex:mutex",
+        "//aos/logging",
+        "//aos/util:options",
     ],
 )
 
@@ -108,11 +108,11 @@
     deps = [
         ":core_lib",
         ":queue",
-        "//aos/common:die",
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/util:death_test_log_implementation",
-        "//aos/common/util:thread",
+        "//aos:die",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/util:death_test_log_implementation",
+        "//aos/util:thread",
         "//aos/testing:googletest",
         "//aos/testing:prevent_exit",
         "//aos/testing:test_shm",
@@ -132,12 +132,12 @@
     ],
     deps = [
         ":core_lib",
-        "//aos/common:die",
-        "//aos/common:mutex",
-        "//aos/common:time",
-        "//aos/common/libc:aos_strsignal",
-        "//aos/common/libc:dirname",
-        "//aos/common/logging",
+        "//aos:die",
+        "//aos/mutex:mutex",
+        "//aos/time:time",
+        "//aos/libc:aos_strsignal",
+        "//aos/libc:dirname",
+        "//aos/logging",
         "//aos/testing:googletest",
         "//aos/testing:test_shm",
     ],
@@ -157,11 +157,11 @@
     ],
     deps = [
         ":queue",
-        "//aos/common:condition",
-        "//aos/common:event",
-        "//aos/common:mutex",
-        "//aos/common/logging",
-        "//aos/common/logging:implementations",
+        "//aos:condition",
+        "//aos:event",
+        "//aos/mutex:mutex",
+        "//aos/logging",
+        "//aos/logging:implementations",
         "//aos/linux_code:init",
         "//third_party/gflags",
     ],
diff --git a/aos/linux_code/ipc_lib/aos_sync.cc b/aos/linux_code/ipc_lib/aos_sync.cc
index d0baaa0..af7a669 100644
--- a/aos/linux_code/ipc_lib/aos_sync.cc
+++ b/aos/linux_code/ipc_lib/aos_sync.cc
@@ -26,9 +26,9 @@
 #include <algorithm>
 #include <type_traits>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/macros.h"
-#include "aos/common/util/compiler_memory_barrier.h"
+#include "aos/logging/logging.h"
+#include "aos/macros.h"
+#include "aos/util/compiler_memory_barrier.h"
 #include "aos/once.h"
 
 using ::aos::linux_code::ipc_lib::FutexAccessorObserver;
diff --git a/aos/linux_code/ipc_lib/ipc_comparison.cc b/aos/linux_code/ipc_lib/ipc_comparison.cc
index 11373a5..6e67e13 100644
--- a/aos/linux_code/ipc_lib/ipc_comparison.cc
+++ b/aos/linux_code/ipc_lib/ipc_comparison.cc
@@ -21,12 +21,12 @@
 #include <string>
 #include <thread>
 
-#include "aos/common/condition.h"
-#include "aos/common/event.h"
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/mutex.h"
-#include "aos/common/time.h"
+#include "aos/condition.h"
+#include "aos/event.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/logging.h"
+#include "aos/mutex/mutex.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
 #include "aos/linux_code/ipc_lib/queue.h"
 
diff --git a/aos/linux_code/ipc_lib/ipc_stress_test.cc b/aos/linux_code/ipc_lib/ipc_stress_test.cc
index 1b4d22e..e43e6a5 100644
--- a/aos/linux_code/ipc_lib/ipc_stress_test.cc
+++ b/aos/linux_code/ipc_lib/ipc_stress_test.cc
@@ -9,13 +9,13 @@
 #include <chrono>
 #include <string>
 
-#include "aos/common/die.h"
-#include "aos/common/libc/aos_strsignal.h"
-#include "aos/common/libc/dirname.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/mutex.h"
-#include "aos/common/time.h"
-#include "aos/common/type_traits.h"
+#include "aos/die.h"
+#include "aos/libc/aos_strsignal.h"
+#include "aos/libc/dirname.h"
+#include "aos/logging/logging.h"
+#include "aos/mutex/mutex.h"
+#include "aos/time/time.h"
+#include "aos/type_traits/type_traits.h"
 #include "aos/linux_code/ipc_lib/core_lib.h"
 #include "aos/testing/test_shm.h"
 
diff --git a/aos/linux_code/ipc_lib/queue.cc b/aos/linux_code/ipc_lib/queue.cc
index b874b08..a89554d 100644
--- a/aos/linux_code/ipc_lib/queue.cc
+++ b/aos/linux_code/ipc_lib/queue.cc
@@ -13,7 +13,7 @@
 #include <memory>
 #include <algorithm>
 
-#include "aos/common/type_traits.h"
+#include "aos/type_traits/type_traits.h"
 #include "aos/linux_code/ipc_lib/core_lib.h"
 
 namespace aos {
diff --git a/aos/linux_code/ipc_lib/queue.h b/aos/linux_code/ipc_lib/queue.h
index 0e6c3ae..1a0d174 100644
--- a/aos/linux_code/ipc_lib/queue.h
+++ b/aos/linux_code/ipc_lib/queue.h
@@ -2,10 +2,10 @@
 #define AOS_LINUX_CODE_IPC_LIB_QUEUE_H_
 
 #include "aos/linux_code/ipc_lib/shared_mem.h"
-#include "aos/common/mutex.h"
-#include "aos/common/condition.h"
-#include "aos/common/util/options.h"
-#include "aos/common/logging/logging.h"
+#include "aos/mutex/mutex.h"
+#include "aos/condition.h"
+#include "aos/util/options.h"
+#include "aos/logging/logging.h"
 
 // TODO(brians) add valgrind client requests to the queue and shared_mem_malloc
 // code to make checking for leaks work better
diff --git a/aos/linux_code/ipc_lib/raw_queue_test.cc b/aos/linux_code/ipc_lib/raw_queue_test.cc
index 0c341e3..08b7445 100644
--- a/aos/linux_code/ipc_lib/raw_queue_test.cc
+++ b/aos/linux_code/ipc_lib/raw_queue_test.cc
@@ -12,14 +12,14 @@
 #include "gtest/gtest.h"
 
 #include "aos/linux_code/ipc_lib/core_lib.h"
-#include "aos/common/type_traits.h"
+#include "aos/type_traits/type_traits.h"
 #include "aos/testing/test_shm.h"
-#include "aos/common/time.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/die.h"
-#include "aos/common/util/thread.h"
-#include "aos/common/util/options.h"
-#include "aos/common/util/death_test_log_implementation.h"
+#include "aos/time/time.h"
+#include "aos/logging/logging.h"
+#include "aos/die.h"
+#include "aos/util/thread.h"
+#include "aos/util/options.h"
+#include "aos/util/death_test_log_implementation.h"
 #include "aos/testing/prevent_exit.h"
 
 using ::testing::AssertionResult;
diff --git a/aos/linux_code/ipc_lib/shared_mem.c b/aos/linux_code/ipc_lib/shared_mem.c
index f0a2aee..e0f1bfb 100644
--- a/aos/linux_code/ipc_lib/shared_mem.c
+++ b/aos/linux_code/ipc_lib/shared_mem.c
@@ -11,7 +11,7 @@
 #include <assert.h>
 
 #include "aos/linux_code/ipc_lib/core_lib.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "aos/linux_code/ipc_lib/aos_sync.h"
 
 // the path for the shared memory segment. see shm_open(3) for restrictions
diff --git a/aos/linux_code/starter/BUILD b/aos/linux_code/starter/BUILD
index 74af77d..68b39bd 100644
--- a/aos/linux_code/starter/BUILD
+++ b/aos/linux_code/starter/BUILD
@@ -16,12 +16,12 @@
   deps = [
     '//aos/linux_code:init',
     '//third_party/libevent',
-    '//aos/common/logging',
-    '//aos/common/logging:implementations',
+    '//aos/logging',
+    '//aos/logging:implementations',
     '//aos:once',
-    '//aos/common:time',
-    '//aos/common/libc:aos_strsignal',
-    '//aos/common/util:run_command',
-    '//aos/common:unique_malloc_ptr',
+    '//aos/time:time',
+    '//aos/libc:aos_strsignal',
+    '//aos/util:run_command',
+    '//aos:unique_malloc_ptr',
   ],
 )
diff --git a/aos/linux_code/starter/starter.cc b/aos/linux_code/starter/starter.cc
index 62e540b..0c7fdea 100644
--- a/aos/linux_code/starter/starter.cc
+++ b/aos/linux_code/starter/starter.cc
@@ -29,12 +29,12 @@
 
 #include "third_party/libevent/event.h"
 
-#include "aos/common/libc/aos_strsignal.h"
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/time.h"
-#include "aos/common/unique_malloc_ptr.h"
-#include "aos/common/util/run_command.h"
+#include "aos/libc/aos_strsignal.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/logging.h"
+#include "aos/time/time.h"
+#include "aos/unique_malloc_ptr.h"
+#include "aos/util/run_command.h"
 #include "aos/linux_code/init.h"
 #include "aos/once.h"
 
diff --git a/aos/common/logging/BUILD b/aos/logging/BUILD
similarity index 81%
rename from aos/common/logging/BUILD
rename to aos/logging/BUILD
index 09e355d..a8ee8e9 100644
--- a/aos/common/logging/BUILD
+++ b/aos/logging/BUILD
@@ -16,9 +16,9 @@
     visibility = ["//visibility:public"],
     deps = [
         ":sizes",
-        "//aos/common:die",
-        "//aos/common:macros",
-        "//aos/common/libc:aos_strerror",
+        "//aos:die",
+        "//aos:macros",
+        "//aos/libc:aos_strerror",
         "//aos/linux_code:complex_thread_local",
     ],
 )
@@ -35,7 +35,7 @@
     deps = [
         ":binary_log_file",
         ":logging",
-        "//aos/common:queues",
+        "//aos:queues",
         "//aos/linux_code/ipc_lib:queue",
     ],
 )
@@ -50,9 +50,9 @@
         ":binary_log_file",
         ":implementations",
         ":logging",
-        "//aos/common:die",
-        "//aos/common:queue_types",
-        "//aos/common:time",
+        "//aos:die",
+        "//aos:queue_types",
+        "//aos/time:time",
         "//aos/linux_code:configuration",
         "//aos/linux_code:init",
         "//aos/linux_code/ipc_lib:queue",
@@ -68,7 +68,7 @@
     deps = [
         ":implementations",
         ":logging",
-        "//aos/common:time",
+        "//aos/time:time",
         "//aos/linux_code:init",
         "//aos/linux_code/ipc_lib:queue",
     ],
@@ -84,8 +84,8 @@
         ":binary_log_file",
         ":implementations",
         ":logging",
-        "//aos/common:queue_types",
-        "//aos/common/util:string_to_num",
+        "//aos:queue_types",
+        "//aos/util:string_to_num",
         "//aos/linux_code:configuration",
         "//aos/linux_code:init",
     ],
@@ -141,8 +141,8 @@
     deps = [
         ":logging",
         ":sizes",
-        "//aos/common:die",
-        "//aos/common:queue_types",
+        "//aos:die",
+        "//aos:queue_types",
     ],
 )
 
@@ -158,9 +158,9 @@
     deps = [
         ":logging",
         ":sizes",
-        "//aos/common:die",
-        "//aos/common:generated_queue_headers",
-        "//aos/common:queue_types",
+        "//aos:die",
+        "//aos:generated_queue_headers",
+        "//aos:queue_types",
         "//third_party/eigen",
     ],
 )
@@ -175,7 +175,7 @@
     ],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/common:macros",
+        "//aos:macros",
     ],
 )
 
@@ -198,12 +198,12 @@
         ":logging",
         ":sizes",
         "//aos:once",
-        "//aos/common:die",
-        "//aos/common:macros",
-        "//aos/common:mutex",
-        "//aos/common:queue_types",
-        "//aos/common:time",
-        "//aos/common:type_traits",
+        "//aos:die",
+        "//aos:macros",
+        "//aos/mutex:mutex",
+        "//aos:queue_types",
+        "//aos/time:time",
+        "//aos/type_traits:type_traits",
         "//aos/linux_code/ipc_lib:queue",
     ],
 )
diff --git a/aos/common/logging/binary_log_file.cc b/aos/logging/binary_log_file.cc
similarity index 99%
rename from aos/common/logging/binary_log_file.cc
rename to aos/logging/binary_log_file.cc
index be58e11..ca62b73 100644
--- a/aos/common/logging/binary_log_file.cc
+++ b/aos/logging/binary_log_file.cc
@@ -1,4 +1,4 @@
-#include "aos/common/logging/binary_log_file.h"
+#include "aos/logging/binary_log_file.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/aos/common/logging/binary_log_file.h b/aos/logging/binary_log_file.h
similarity index 96%
rename from aos/common/logging/binary_log_file.h
rename to aos/logging/binary_log_file.h
index 7f9506e..79b580d 100644
--- a/aos/common/logging/binary_log_file.h
+++ b/aos/logging/binary_log_file.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_LOGGING_BINARY_LOG_FILE_H_
-#define AOS_COMMON_LOGGING_BINARY_LOG_FILE_H_
+#ifndef AOS_LOGGING_BINARY_LOG_FILE_H_
+#define AOS_LOGGING_BINARY_LOG_FILE_H_
 
 #include <sys/types.h>
 #include <stddef.h>
@@ -7,7 +7,7 @@
 
 #include <algorithm>
 
-#include "aos/common/logging/implementations.h"
+#include "aos/logging/implementations.h"
 
 namespace aos {
 namespace logging {
@@ -204,4 +204,4 @@
 }  // namespace logging
 }  // namespace aos
 
-#endif  // AOS_COMMON_LOGGING_BINARY_LOG_FILE_H_
+#endif  // AOS_LOGGING_BINARY_LOG_FILE_H_
diff --git a/aos/common/logging/binary_log_writer.cc b/aos/logging/binary_log_writer.cc
similarity index 97%
rename from aos/common/logging/binary_log_writer.cc
rename to aos/logging/binary_log_writer.cc
index 076d72d..fb0c4c2 100644
--- a/aos/common/logging/binary_log_writer.cc
+++ b/aos/logging/binary_log_writer.cc
@@ -15,11 +15,11 @@
 #include <map>
 #include <unordered_set>
 
-#include "aos/common/die.h"
-#include "aos/common/logging/binary_log_file.h"
-#include "aos/common/logging/implementations.h"
-#include "aos/common/queue_types.h"
-#include "aos/common/time.h"
+#include "aos/die.h"
+#include "aos/logging/binary_log_file.h"
+#include "aos/logging/implementations.h"
+#include "aos/queue_types.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/configuration.h"
 #include "aos/linux_code/init.h"
 #include "aos/linux_code/ipc_lib/queue.h"
diff --git a/aos/common/logging/context.cc b/aos/logging/context.cc
similarity index 97%
rename from aos/common/logging/context.cc
rename to aos/logging/context.cc
index aebee02..3701b00 100644
--- a/aos/common/logging/context.cc
+++ b/aos/logging/context.cc
@@ -1,4 +1,4 @@
-#include "aos/common/logging/context.h"
+#include "aos/logging/context.h"
 
 #include <string.h>
 #include <sys/prctl.h>
@@ -7,7 +7,7 @@
 
 #include <string>
 
-#include "aos/common/die.h"
+#include "aos/die.h"
 #include "aos/linux_code/complex_thread_local.h"
 
 namespace aos {
diff --git a/aos/common/logging/context.h b/aos/logging/context.h
similarity index 93%
rename from aos/common/logging/context.h
rename to aos/logging/context.h
index b7fee26..b2abc0d 100644
--- a/aos/common/logging/context.h
+++ b/aos/logging/context.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_LOGGING_CONTEXT_H_
-#define AOS_COMMON_LOGGING_CONTEXT_H_
+#ifndef AOS_LOGGING_CONTEXT_H_
+#define AOS_LOGGING_CONTEXT_H_
 
 #include <inttypes.h>
 #include <stddef.h>
@@ -8,7 +8,7 @@
 
 #include <atomic>
 
-#include "aos/common/logging/sizes.h"
+#include "aos/logging/sizes.h"
 
 namespace aos {
 namespace logging {
@@ -81,4 +81,4 @@
 }  // namespace logging
 }  // namespace aos
 
-#endif  // AOS_COMMON_LOGGING_CONTEXT_H_
+#endif  // AOS_LOGGING_CONTEXT_H_
diff --git a/aos/common/logging/implementations.cc b/aos/logging/implementations.cc
similarity index 98%
rename from aos/common/logging/implementations.cc
rename to aos/logging/implementations.cc
index 58359f9..337aa8f 100644
--- a/aos/common/logging/implementations.cc
+++ b/aos/logging/implementations.cc
@@ -1,4 +1,4 @@
-#include "aos/common/logging/implementations.h"
+#include "aos/logging/implementations.h"
 
 #include <stdarg.h>
 #include <inttypes.h>
@@ -6,10 +6,10 @@
 #include <algorithm>
 #include <chrono>
 
-#include "aos/common/die.h"
-#include "aos/common/logging/printf_formats.h"
-#include "aos/common/queue_types.h"
-#include "aos/common/time.h"
+#include "aos/die.h"
+#include "aos/logging/printf_formats.h"
+#include "aos/queue_types.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/ipc_lib/queue.h"
 #include "aos/once.h"
 
diff --git a/aos/common/logging/implementations.h b/aos/logging/implementations.h
similarity index 94%
rename from aos/common/logging/implementations.h
rename to aos/logging/implementations.h
index 142c6ba..69a805b 100644
--- a/aos/common/logging/implementations.h
+++ b/aos/logging/implementations.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_LOGGING_IMPLEMENTATIONS_H_
-#define AOS_COMMON_LOGGING_IMPLEMENTATIONS_H_
+#ifndef AOS_LOGGING_IMPLEMENTATIONS_H_
+#define AOS_LOGGING_IMPLEMENTATIONS_H_
 
 #include <sys/types.h>
 #include <unistd.h>
@@ -13,13 +13,13 @@
 #include <functional>
 #include <atomic>
 
-#include "aos/common/logging/context.h"
-#include "aos/common/logging/interface.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/sizes.h"
-#include "aos/common/macros.h"
-#include "aos/common/mutex.h"
-#include "aos/common/type_traits.h"
+#include "aos/logging/context.h"
+#include "aos/logging/interface.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/sizes.h"
+#include "aos/macros.h"
+#include "aos/mutex/mutex.h"
+#include "aos/type_traits/type_traits.h"
 #include "aos/once.h"
 
 namespace aos {
@@ -212,4 +212,4 @@
 }  // namespace logging
 }  // namespace aos
 
-#endif  // AOS_COMMON_LOGGING_IMPLEMENTATIONS_H_
+#endif  // AOS_LOGGING_IMPLEMENTATIONS_H_
diff --git a/aos/common/logging/implementations_test.cc b/aos/logging/implementations_test.cc
similarity index 98%
rename from aos/common/logging/implementations_test.cc
rename to aos/logging/implementations_test.cc
index 9663fd2..ef69658 100644
--- a/aos/common/logging/implementations_test.cc
+++ b/aos/logging/implementations_test.cc
@@ -5,9 +5,9 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/logging/implementations.h"
-#include "aos/common/time.h"
-#include "aos/common/logging/printf_formats.h"
+#include "aos/logging/implementations.h"
+#include "aos/time/time.h"
+#include "aos/logging/printf_formats.h"
 
 using ::testing::AssertionResult;
 using ::testing::AssertionSuccess;
diff --git a/aos/common/logging/interface.cc b/aos/logging/interface.cc
similarity index 97%
rename from aos/common/logging/interface.cc
rename to aos/logging/interface.cc
index a601e83..fb3b60e 100644
--- a/aos/common/logging/interface.cc
+++ b/aos/logging/interface.cc
@@ -1,4 +1,4 @@
-#include "aos/common/logging/interface.h"
+#include "aos/logging/interface.h"
 
 #include <stdarg.h>
 #include <stdio.h>
@@ -7,8 +7,8 @@
 #include <type_traits>
 #include <functional>
 
-#include "aos/common/die.h"
-#include "aos/common/logging/context.h"
+#include "aos/die.h"
+#include "aos/logging/context.h"
 
 namespace aos {
 namespace logging {
diff --git a/aos/common/logging/interface.h b/aos/logging/interface.h
similarity index 95%
rename from aos/common/logging/interface.h
rename to aos/logging/interface.h
index dc59858..fafc9e2 100644
--- a/aos/common/logging/interface.h
+++ b/aos/logging/interface.h
@@ -1,13 +1,13 @@
-#ifndef AOS_COMMON_LOGGING_INTERFACE_H_
-#define AOS_COMMON_LOGGING_INTERFACE_H_
+#ifndef AOS_LOGGING_INTERFACE_H_
+#define AOS_LOGGING_INTERFACE_H_
 
 #include <stdarg.h>
 
 #include <string>
 #include <functional>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/macros.h"
+#include "aos/logging/logging.h"
+#include "aos/macros.h"
 
 // This file has the non-C-compatible parts of the logging client interface.
 
@@ -125,4 +125,4 @@
 }  // namespace logging
 }  // namespace aos
 
-#endif  // AOS_COMMON_LOGGING_INTERFACE_H_
+#endif  // AOS_LOGGING_INTERFACE_H_
diff --git a/aos/common/logging/log_displayer.cc b/aos/logging/log_displayer.cc
similarity index 97%
rename from aos/common/logging/log_displayer.cc
rename to aos/logging/log_displayer.cc
index 2f5a5a3..1d40de1 100644
--- a/aos/common/logging/log_displayer.cc
+++ b/aos/logging/log_displayer.cc
@@ -12,12 +12,12 @@
 #include <string>
 
 #include "aos/linux_code/configuration.h"
-#include "aos/common/logging/binary_log_file.h"
-#include "aos/common/queue_types.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/printf_formats.h"
-#include "aos/common/util/string_to_num.h"
+#include "aos/logging/binary_log_file.h"
+#include "aos/queue_types.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/printf_formats.h"
+#include "aos/util/string_to_num.h"
 
 using ::aos::logging::linux_code::LogFileMessageHeader;
 
diff --git a/aos/common/logging/log_streamer.cc b/aos/logging/log_streamer.cc
similarity index 92%
rename from aos/common/logging/log_streamer.cc
rename to aos/logging/log_streamer.cc
index 74e680b..757ba2e 100644
--- a/aos/common/logging/log_streamer.cc
+++ b/aos/logging/log_streamer.cc
@@ -11,9 +11,9 @@
 #include <chrono>
 #include <string>
 
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/time.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/logging.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
 #include "aos/linux_code/ipc_lib/queue.h"
 
diff --git a/aos/common/logging/logging.h b/aos/logging/logging.h
similarity index 98%
rename from aos/common/logging/logging.h
rename to aos/logging/logging.h
index 3182d1a..6682098 100644
--- a/aos/common/logging/logging.h
+++ b/aos/logging/logging.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_LOGGING_LOGGING_H_
-#define AOS_COMMON_LOGGING_LOGGING_H_
+#ifndef AOS_LOGGING_LOGGING_H_
+#define AOS_LOGGING_LOGGING_H_
 
 // This file contains the logging client interface. It works with both C and C++
 // code.
@@ -10,8 +10,8 @@
 #include <string.h>
 #include <errno.h>
 
-#include "aos/common/macros.h"
-#include "aos/common/libc/aos_strerror.h"
+#include "aos/macros.h"
+#include "aos/libc/aos_strerror.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/aos/common/logging/matrix_logging.cc b/aos/logging/matrix_logging.cc
similarity index 90%
rename from aos/common/logging/matrix_logging.cc
rename to aos/logging/matrix_logging.cc
index 7c90632..e17c8a6 100644
--- a/aos/common/logging/matrix_logging.cc
+++ b/aos/logging/matrix_logging.cc
@@ -1,7 +1,7 @@
-#include "aos/common/logging/matrix_logging.h"
+#include "aos/logging/matrix_logging.h"
 
-#include "aos/common/queue_types.h"
-#include "aos/common/logging/sizes.h"
+#include "aos/queue_types.h"
+#include "aos/logging/sizes.h"
 
 namespace aos {
 namespace logging {
diff --git a/aos/common/logging/matrix_logging.h b/aos/logging/matrix_logging.h
similarity index 86%
rename from aos/common/logging/matrix_logging.h
rename to aos/logging/matrix_logging.h
index a915643..630e85e 100644
--- a/aos/common/logging/matrix_logging.h
+++ b/aos/logging/matrix_logging.h
@@ -1,14 +1,14 @@
-#ifndef AOS_COMMON_LOGGING_MATRIX_LOGGING_H_
-#define AOS_COMMON_LOGGING_MATRIX_LOGGING_H_
+#ifndef AOS_LOGGING_MATRIX_LOGGING_H_
+#define AOS_LOGGING_MATRIX_LOGGING_H_
 
 #include <string>
 #include <functional>
 
 #include "Eigen/Dense"
 
-#include "aos/common/logging/interface.h"
-#include "aos/common/die.h"
-#include "aos/common/queue_primitives.h"
+#include "aos/logging/interface.h"
+#include "aos/die.h"
+#include "aos/queue_primitives.h"
 
 namespace aos {
 namespace logging {
@@ -44,4 +44,4 @@
 }  // namespace logging
 }  // namespace aos
 
-#endif  // AOS_COMMON_LOGGING_MATRIX_LOGGING_H_
+#endif  // AOS_LOGGING_MATRIX_LOGGING_H_
diff --git a/aos/common/logging/printf_formats.h b/aos/logging/printf_formats.h
similarity index 85%
rename from aos/common/logging/printf_formats.h
rename to aos/logging/printf_formats.h
index 60960a4..a04f1f2 100644
--- a/aos/common/logging/printf_formats.h
+++ b/aos/logging/printf_formats.h
@@ -1,7 +1,7 @@
-#ifndef AOS_COMMON_LOGGING_PRINTF_FORMATS_H_
-#define AOS_COMMON_LOGGING_PRINTF_FORMATS_H_
+#ifndef AOS_LOGGING_PRINTF_FORMATS_H_
+#define AOS_LOGGING_PRINTF_FORMATS_H_
 
-#include "aos/common/macros.h"
+#include "aos/macros.h"
 
 // This file has printf(3) formats and corresponding arguments for printing out
 // times and log messages.
@@ -25,4 +25,4 @@
 #define AOS_TIME_NSECONDS_DIGITS 6
 #define AOS_TIME_NSECONDS_DENOMINATOR 1000
 
-#endif  // AOS_COMMON_LOGGING_PRINTF_FORMATS_H_
+#endif  // AOS_LOGGING_PRINTF_FORMATS_H_
diff --git a/aos/common/logging/queue_logging.cc b/aos/logging/queue_logging.cc
similarity index 86%
rename from aos/common/logging/queue_logging.cc
rename to aos/logging/queue_logging.cc
index 0f1227c..541ddb1 100644
--- a/aos/common/logging/queue_logging.cc
+++ b/aos/logging/queue_logging.cc
@@ -1,8 +1,8 @@
-#include "aos/common/logging/queue_logging.h"
+#include "aos/logging/queue_logging.h"
 
-#include "aos/common/logging/interface.h"
-#include "aos/common/logging/sizes.h"
-#include "aos/common/queue_types.h"
+#include "aos/logging/interface.h"
+#include "aos/logging/sizes.h"
+#include "aos/queue_types.h"
 
 namespace aos {
 namespace logging {
diff --git a/aos/common/logging/queue_logging.h b/aos/logging/queue_logging.h
similarity index 86%
rename from aos/common/logging/queue_logging.h
rename to aos/logging/queue_logging.h
index 888f808..a390412 100644
--- a/aos/common/logging/queue_logging.h
+++ b/aos/logging/queue_logging.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_LOGGING_QUEUE_LOGGING_H_
-#define AOS_COMMON_LOGGING_QUEUE_LOGGING_H_
+#ifndef AOS_LOGGING_QUEUE_LOGGING_H_
+#define AOS_LOGGING_QUEUE_LOGGING_H_
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -7,8 +7,8 @@
 #include <functional>
 #include <string>
 
-#include "aos/common/logging/interface.h"
-#include "aos/common/die.h"
+#include "aos/logging/interface.h"
+#include "aos/die.h"
 
 namespace aos {
 namespace logging {
@@ -40,4 +40,4 @@
 }  // namespace logging
 }  // namespace aos
 
-#endif  // AOS_COMMON_LOGGING_QUEUE_LOGGING_H_
+#endif  // AOS_LOGGING_QUEUE_LOGGING_H_
diff --git a/aos/common/logging/replay.cc b/aos/logging/replay.cc
similarity index 97%
rename from aos/common/logging/replay.cc
rename to aos/logging/replay.cc
index 6b55e51..c58ee8c 100644
--- a/aos/common/logging/replay.cc
+++ b/aos/logging/replay.cc
@@ -1,4 +1,4 @@
-#include "aos/common/logging/replay.h"
+#include "aos/logging/replay.h"
 
 #include <chrono>
 
diff --git a/aos/common/logging/replay.h b/aos/logging/replay.h
similarity index 94%
rename from aos/common/logging/replay.h
rename to aos/logging/replay.h
index 1a8418f..0de207a 100644
--- a/aos/common/logging/replay.h
+++ b/aos/logging/replay.h
@@ -1,17 +1,17 @@
-#ifndef AOS_COMMON_LOGGING_REPLAY_H_
-#define AOS_COMMON_LOGGING_REPLAY_H_
+#ifndef AOS_LOGGING_REPLAY_H_
+#define AOS_LOGGING_REPLAY_H_
 
 #include <unordered_map>
 #include <string>
 #include <functional>
 #include <memory>
 
-#include "aos/common/logging/binary_log_file.h"
-#include "aos/common/queue.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/macros.h"
+#include "aos/logging/binary_log_file.h"
+#include "aos/queue.h"
+#include "aos/logging/logging.h"
+#include "aos/macros.h"
 #include "aos/linux_code/ipc_lib/queue.h"
-#include "aos/common/queue_types.h"
+#include "aos/queue_types.h"
 
 namespace aos {
 namespace logging {
@@ -163,4 +163,4 @@
 }  // namespace logging
 }  // namespace aos
 
-#endif  // AOS_COMMON_LOGGING_REPLAY_H_
+#endif  // AOS_LOGGING_REPLAY_H_
diff --git a/aos/logging/sizes.h b/aos/logging/sizes.h
new file mode 100644
index 0000000..b624a61
--- /dev/null
+++ b/aos/logging/sizes.h
@@ -0,0 +1,9 @@
+#ifndef AOS_LOGGING_SIZES_H_
+#define AOS_LOGGING_SIZES_H_
+
+// This file exists so C code and context.h can both get at these constants...
+
+#define LOG_MESSAGE_LEN 500
+#define LOG_MESSAGE_NAME_LEN 100
+
+#endif  // AOS_LOGGING_SIZES_H_
diff --git a/aos/common/macros.h b/aos/macros.h
similarity index 91%
rename from aos/common/macros.h
rename to aos/macros.h
index e8558b2..9f8a368 100644
--- a/aos/common/macros.h
+++ b/aos/macros.h
@@ -1,5 +1,5 @@
-#ifndef _AOS_COMMON_MACROS_H_
-#define _AOS_COMMON_MACROS_H_
+#ifndef _AOS_MACROS_H_
+#define _AOS_MACROS_H_
 
 // This file has some common macros etc.
 
@@ -38,4 +38,4 @@
 #endif
 #endif
 
-#endif  // _AOS_COMMON_MACROS_H_
+#endif  // _AOS_MACROS_H_
diff --git a/aos/messages/BUILD b/aos/messages/BUILD
new file mode 100644
index 0000000..532a3b6
--- /dev/null
+++ b/aos/messages/BUILD
@@ -0,0 +1,19 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "messages",
+    srcs = [
+        "message.cc",
+    ],
+    hdrs = [
+        "message.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    deps = [
+        "//aos:byteorder",
+        "//aos:macros",
+        "//aos/time:time",
+    ],
+)
diff --git a/aos/common/message.cc b/aos/messages/message.cc
similarity index 95%
rename from aos/common/message.cc
rename to aos/messages/message.cc
index 18acaa9..63e1a71 100644
--- a/aos/common/message.cc
+++ b/aos/messages/message.cc
@@ -1,9 +1,9 @@
-#include "aos/common/message.h"
+#include "aos/messages/message.h"
 
 #include <inttypes.h>
 #include <chrono>
 
-#include "aos/common/byteorder.h"
+#include "aos/byteorder.h"
 
 namespace aos {
 
diff --git a/aos/common/message.h b/aos/messages/message.h
similarity index 91%
rename from aos/common/message.h
rename to aos/messages/message.h
index f46969f..2a8604b 100644
--- a/aos/common/message.h
+++ b/aos/messages/message.h
@@ -1,7 +1,7 @@
-#ifndef AOS_COMMON_MESSAGE_H_
-#define AOS_COMMON_MESSAGE_H_
+#ifndef AOS_MESSAGE_H_
+#define AOS_MESSAGE_H_
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 
 namespace aos {
 
@@ -54,4 +54,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_MESSAGE_H_
+#endif  // AOS_MESSAGE_H_
diff --git a/aos/mutex/BUILD b/aos/mutex/BUILD
new file mode 100644
index 0000000..02cec57
--- /dev/null
+++ b/aos/mutex/BUILD
@@ -0,0 +1,38 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "mutex",
+    srcs = [
+        "mutex.cc",
+    ],
+    hdrs = [
+        "mutex.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    deps = [
+        "//aos:die",
+        "//aos/type_traits:type_traits",
+        "//aos/logging",
+        "//aos/linux_code/ipc_lib:aos_sync",
+    ],
+)
+
+cc_test(
+    name = "mutex_test",
+    srcs = [
+        "mutex_test.cc",
+    ],
+    deps = [
+        "//aos:die",
+        ":mutex",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/util:death_test_log_implementation",
+        "//aos/util:thread",
+        "//aos/testing:googletest",
+        "//aos/testing:test_logging",
+        "//aos/testing:test_shm",
+    ],
+)
diff --git a/aos/common/mutex.cc b/aos/mutex/mutex.cc
similarity index 89%
rename from aos/common/mutex.cc
rename to aos/mutex/mutex.cc
index e8951c6..a35f0cd 100644
--- a/aos/common/mutex.cc
+++ b/aos/mutex/mutex.cc
@@ -1,11 +1,11 @@
-#include "aos/common/mutex.h"
+#include "aos/mutex/mutex.h"
 
 #include <inttypes.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "aos/common/type_traits.h"
-#include "aos/common/logging/logging.h"
+#include "aos/type_traits/type_traits.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 
diff --git a/aos/common/mutex.h b/aos/mutex/mutex.h
similarity index 95%
rename from aos/common/mutex.h
rename to aos/mutex/mutex.h
index 3486c15..8bd986c 100644
--- a/aos/common/mutex.h
+++ b/aos/mutex/mutex.h
@@ -1,9 +1,9 @@
-#ifndef AOS_COMMON_MUTEX_H_
-#define AOS_COMMON_MUTEX_H_
+#ifndef AOS_MUTEX_H_
+#define AOS_MUTEX_H_
 
-#include "aos/common/macros.h"
-#include "aos/common/type_traits.h"
-#include "aos/common/die.h"
+#include "aos/macros.h"
+#include "aos/type_traits/type_traits.h"
+#include "aos/die.h"
 #include "aos/linux_code/ipc_lib/aos_sync.h"
 
 namespace aos {
@@ -147,4 +147,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_MUTEX_H_
+#endif  // AOS_MUTEX_H_
diff --git a/aos/common/mutex_test.cc b/aos/mutex/mutex_test.cc
similarity index 97%
rename from aos/common/mutex_test.cc
rename to aos/mutex/mutex_test.cc
index 18c616b..8e3daac 100644
--- a/aos/common/mutex_test.cc
+++ b/aos/mutex/mutex_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/mutex.h"
+#include "aos/mutex/mutex.h"
 
 #include <math.h>
 #include <pthread.h>
@@ -9,10 +9,10 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/die.h"
-#include "aos/common/time.h"
-#include "aos/common/util/death_test_log_implementation.h"
-#include "aos/common/util/thread.h"
+#include "aos/die.h"
+#include "aos/time/time.h"
+#include "aos/util/death_test_log_implementation.h"
+#include "aos/util/thread.h"
 #include "aos/linux_code/ipc_lib/aos_sync.h"
 #include "aos/linux_code/ipc_lib/core_lib.h"
 #include "aos/testing/test_logging.h"
diff --git a/aos/common/network/BUILD b/aos/network/BUILD
similarity index 86%
rename from aos/common/network/BUILD
rename to aos/network/BUILD
index 9484bc5..5c1eb03 100644
--- a/aos/common/network/BUILD
+++ b/aos/network/BUILD
@@ -13,8 +13,8 @@
     ],
     deps = [
         "//aos:once",
-        "//aos/common/logging",
-        "//aos/common/util:string_to_num",
+        "//aos/logging",
+        "//aos/util:string_to_num",
         "//aos/linux_code:configuration",
     ],
 )
diff --git a/aos/common/network/team_number.cc b/aos/network/team_number.cc
similarity index 93%
rename from aos/common/network/team_number.cc
rename to aos/network/team_number.cc
index 0669601..eb17e7a 100644
--- a/aos/common/network/team_number.cc
+++ b/aos/network/team_number.cc
@@ -1,4 +1,4 @@
-#include "aos/common/network/team_number.h"
+#include "aos/network/team_number.h"
 
 #include <netinet/in.h>
 #include <inttypes.h>
@@ -7,8 +7,8 @@
 
 #include <string>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/util/string_to_num.h"
+#include "aos/logging/logging.h"
+#include "aos/util/string_to_num.h"
 #include "aos/linux_code/configuration.h"
 #include "aos/once.h"
 
diff --git a/aos/common/network/team_number.h b/aos/network/team_number.h
similarity index 84%
rename from aos/common/network/team_number.h
rename to aos/network/team_number.h
index 5a14872..6540283 100644
--- a/aos/common/network/team_number.h
+++ b/aos/network/team_number.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_NETWORK_TEAM_NUMBER_H_
-#define AOS_COMMON_NETWORK_TEAM_NUMBER_H_
+#ifndef AOS_NETWORK_TEAM_NUMBER_H_
+#define AOS_NETWORK_TEAM_NUMBER_H_
 
 #include <stdint.h>
 
@@ -26,4 +26,4 @@
 }  // namespace network
 }  // namespace aos
 
-#endif  // AOS_COMMON_NETWORK_TEAM_NUMBER_H_
+#endif  // AOS_NETWORK_TEAM_NUMBER_H_
diff --git a/aos/common/network/team_number_test.cc b/aos/network/team_number_test.cc
similarity index 90%
rename from aos/common/network/team_number_test.cc
rename to aos/network/team_number_test.cc
index f0adcce..ee3f2db 100644
--- a/aos/common/network/team_number_test.cc
+++ b/aos/network/team_number_test.cc
@@ -1,8 +1,8 @@
-#include "aos/common/network/team_number.h"
+#include "aos/network/team_number.h"
 
 #include "gtest/gtest.h"
 
-#include "aos/common/macros.h"
+#include "aos/macros.h"
 
 namespace aos {
 namespace network {
diff --git a/aos/common/network_port.h b/aos/network_port.h
similarity index 88%
rename from aos/common/network_port.h
rename to aos/network_port.h
index b523674..0c84b5e 100644
--- a/aos/common/network_port.h
+++ b/aos/network_port.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_NETWORK_PORT_H_
-#define AOS_COMMON_NETWORK_PORT_H_
+#ifndef AOS_NETWORK_PORT_H_
+#define AOS_NETWORK_PORT_H_
 
 #include <stdint.h>
 
@@ -29,4 +29,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_NETWORK_PORT_H_
+#endif  // AOS_NETWORK_PORT_H_
diff --git a/aos/once-tmpl.h b/aos/once-tmpl.h
index 0618395..b6f41cc 100644
--- a/aos/once-tmpl.h
+++ b/aos/once-tmpl.h
@@ -4,7 +4,7 @@
 #include <sched.h>
 #endif
 
-#include "aos/common/type_traits.h"
+#include "aos/type_traits/type_traits.h"
 
 // It doesn't use pthread_once, because Brian looked at the pthreads
 // implementation for vxworks and noticed that it is completely and entirely
diff --git a/aos/once.h b/aos/once.h
index f6954f6..d7eb0d3 100644
--- a/aos/once.h
+++ b/aos/once.h
@@ -3,7 +3,7 @@
 
 #include <stdint.h>
 
-#include "aos/common/gtest_prod.h"
+#include "aos/gtest_prod.h"
 
 namespace aos {
 namespace testing {
diff --git a/aos/common/print_field_helpers.h b/aos/print_field_helpers.h
similarity index 86%
rename from aos/common/print_field_helpers.h
rename to aos/print_field_helpers.h
index 0dd2fab..933ce46 100644
--- a/aos/common/print_field_helpers.h
+++ b/aos/print_field_helpers.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_PRINT_FIELD_HELPERS_H_
-#define AOS_COMMON_PRINT_FIELD_HELPERS_H_
+#ifndef AOS_PRINT_FIELD_HELPERS_H_
+#define AOS_PRINT_FIELD_HELPERS_H_
 
 #include <stdint.h>
 
@@ -38,4 +38,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_PRINT_FIELD_HELPERS_H_
+#endif  // AOS_PRINT_FIELD_HELPERS_H_
diff --git a/aos/protobuf/BUILD b/aos/protobuf/BUILD
index c5439c3..69c49d1 100644
--- a/aos/protobuf/BUILD
+++ b/aos/protobuf/BUILD
@@ -5,7 +5,7 @@
   srcs = ["stack_arena.cc"],
   hdrs = ["stack_arena.h"],
   deps = [
-    "//aos/common/logging:logging",
+    "//aos/logging:logging",
     "//third_party/protobuf",
   ],
 )
@@ -16,7 +16,7 @@
   deps = [
     ":stack_arena",
     "//aos/testing:test_logging",
-    "//aos/common/logging:logging",
+    "//aos/logging:logging",
     "//aos/testing:googletest",
   ],
 )
diff --git a/aos/protobuf/stack_arena.cc b/aos/protobuf/stack_arena.cc
index d1a69d6..da9b004 100644
--- a/aos/protobuf/stack_arena.cc
+++ b/aos/protobuf/stack_arena.cc
@@ -1,4 +1,4 @@
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace protobuf {
diff --git a/aos/protobuf/stack_arena_test.cc b/aos/protobuf/stack_arena_test.cc
index dfd9151..c9eb5e8 100644
--- a/aos/protobuf/stack_arena_test.cc
+++ b/aos/protobuf/stack_arena_test.cc
@@ -1,6 +1,6 @@
 #include "gtest/gtest.h"
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "aos/protobuf/stack_arena.h"
 #include "aos/testing/test_logging.h"
 
diff --git a/aos/common/queue.h b/aos/queue.h
similarity index 97%
rename from aos/common/queue.h
rename to aos/queue.h
index 97947ad..47f9503 100644
--- a/aos/common/queue.h
+++ b/aos/queue.h
@@ -1,11 +1,11 @@
-#ifndef AOS_COMMON_QUEUE_H_
-#define AOS_COMMON_QUEUE_H_
+#ifndef AOS_QUEUE_H_
+#define AOS_QUEUE_H_
 
 #include <assert.h>
 
-#include "aos/common/macros.h"
+#include "aos/macros.h"
 #include "aos/linux_code/ipc_lib/queue.h"
-#include "aos/common/message.h"
+#include "aos/messages/message.h"
 
 namespace aos {
 
@@ -225,4 +225,4 @@
 
 #include "aos/linux_code/queue-tmpl.h"
 
-#endif  // AOS_COMMON_QUEUE_H_
+#endif  // AOS_QUEUE_H_
diff --git a/aos/common/queue_test.cc b/aos/queue_test.cc
similarity index 98%
rename from aos/common/queue_test.cc
rename to aos/queue_test.cc
index eb109ba..8eeca6e 100644
--- a/aos/common/queue_test.cc
+++ b/aos/queue_test.cc
@@ -5,9 +5,9 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/die.h"
-#include "aos/common/test_queue.q.h"
-#include "aos/common/util/thread.h"
+#include "aos/die.h"
+#include "aos/test_queue.q.h"
+#include "aos/util/thread.h"
 #include "aos/testing/test_shm.h"
 
 namespace aos {
diff --git a/aos/common/queue_types.cc b/aos/queue_types.cc
similarity index 98%
rename from aos/common/queue_types.cc
rename to aos/queue_types.cc
index 3945395..27b497c 100644
--- a/aos/common/queue_types.cc
+++ b/aos/queue_types.cc
@@ -1,15 +1,15 @@
-#include "aos/common/queue_types.h"
+#include "aos/queue_types.h"
 
 #include <inttypes.h>
 
 #include <memory>
 #include <unordered_map>
 
-#include "aos/common/byteorder.h"
+#include "aos/byteorder.h"
 #include "aos/linux_code/ipc_lib/shared_mem.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "aos/linux_code/ipc_lib/core_lib.h"
-#include "aos/common/mutex.h"
+#include "aos/mutex/mutex.h"
 
 namespace aos {
 
diff --git a/aos/common/queue_types.h b/aos/queue_types.h
similarity index 96%
rename from aos/common/queue_types.h
rename to aos/queue_types.h
index be943c1..bff06bb 100644
--- a/aos/common/queue_types.h
+++ b/aos/queue_types.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_QUEUE_TYPES_H_
-#define AOS_COMMON_QUEUE_TYPES_H_
+#ifndef AOS_QUEUE_TYPES_H_
+#define AOS_QUEUE_TYPES_H_
 
 #include <sys/types.h>
 #include <stdint.h>
@@ -8,8 +8,8 @@
 #include <initializer_list>
 #include <string>
 
-#include "aos/common/macros.h"
-#include "aos/common/byteorder.h"
+#include "aos/macros.h"
+#include "aos/byteorder.h"
 
 namespace aos {
 
@@ -145,4 +145,4 @@
 }  // namespace type_cache
 }  // namespace aos
 
-#endif  // AOS_COMMON_QUEUE_TYPES_H_
+#endif  // AOS_QUEUE_TYPES_H_
diff --git a/aos/common/queue_types_test.cc b/aos/queue_types_test.cc
similarity index 97%
rename from aos/common/queue_types_test.cc
rename to aos/queue_types_test.cc
index 96d02bc..91a1f74 100644
--- a/aos/common/queue_types_test.cc
+++ b/aos/queue_types_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/queue_types.h"
+#include "aos/queue_types.h"
 
 #include <memory>
 #include <limits>
@@ -6,10 +6,10 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/test_queue.q.h"
-#include "aos/common/byteorder.h"
-#include "aos/common/queue_primitives.h"
-#include "aos/common/logging/logging.h"
+#include "aos/test_queue.q.h"
+#include "aos/byteorder.h"
+#include "aos/queue_primitives.h"
+#include "aos/logging/logging.h"
 #include "aos/testing/test_logging.h"
 
 using ::aos::common::testing::Structure;
diff --git a/aos/ring_buffer/BUILD b/aos/ring_buffer/BUILD
new file mode 100644
index 0000000..9f6ab06
--- /dev/null
+++ b/aos/ring_buffer/BUILD
@@ -0,0 +1,19 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "ring_buffer",
+    hdrs = [
+        "ring_buffer.h",
+    ],
+)
+
+cc_test(
+    name = "ring_buffer_test",
+    srcs = [
+        "ring_buffer_test.cc",
+    ],
+    deps = [
+        ":ring_buffer",
+        "//aos/testing:googletest",
+    ],
+)
diff --git a/aos/common/ring_buffer.h b/aos/ring_buffer/ring_buffer.h
similarity index 93%
rename from aos/common/ring_buffer.h
rename to aos/ring_buffer/ring_buffer.h
index 2e44a5e..9f93a8c 100644
--- a/aos/common/ring_buffer.h
+++ b/aos/ring_buffer/ring_buffer.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_RING_BUFFER_H_
-#define AOS_COMMON_RING_BUFFER_H_
+#ifndef AOS_RING_BUFFER_H_
+#define AOS_RING_BUFFER_H_
 
 #include <array>
 
@@ -66,4 +66,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_RING_BUFFER_H_
+#endif  // AOS_RING_BUFFER_H_
diff --git a/aos/common/ring_buffer_test.cc b/aos/ring_buffer/ring_buffer_test.cc
similarity index 98%
rename from aos/common/ring_buffer_test.cc
rename to aos/ring_buffer/ring_buffer_test.cc
index 5aa7327..a01b315 100644
--- a/aos/common/ring_buffer_test.cc
+++ b/aos/ring_buffer/ring_buffer_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/ring_buffer.h"
+#include "aos/ring_buffer/ring_buffer.h"
 
 #include "gtest/gtest.h"
 
diff --git a/aos/common/messages/BUILD b/aos/robot_state/BUILD
similarity index 100%
rename from aos/common/messages/BUILD
rename to aos/robot_state/BUILD
diff --git a/aos/common/messages/robot_state.q b/aos/robot_state/robot_state.q
similarity index 100%
rename from aos/common/messages/robot_state.q
rename to aos/robot_state/robot_state.q
diff --git a/aos/scoped/BUILD b/aos/scoped/BUILD
new file mode 100644
index 0000000..04f0e06
--- /dev/null
+++ b/aos/scoped/BUILD
@@ -0,0 +1,14 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "scoped_fd",
+    hdrs = [
+        "scoped_fd.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    deps = [
+        "//aos/logging",
+    ],
+)
diff --git a/aos/common/scoped_fd.h b/aos/scoped/scoped_fd.h
similarity index 79%
rename from aos/common/scoped_fd.h
rename to aos/scoped/scoped_fd.h
index 29ccf6e..696cf3b 100644
--- a/aos/common/scoped_fd.h
+++ b/aos/scoped/scoped_fd.h
@@ -1,10 +1,10 @@
-#ifndef _AOS_COMMON_SCOPED_FD_
-#define _AOS_COMMON_SCOPED_FD_
+#ifndef _AOS_SCOPED_FD_
+#define _AOS_SCOPED_FD_
 
 #include <unistd.h>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/macros.h"
+#include "aos/logging/logging.h"
+#include "aos/macros.h"
 
 namespace aos {
 
@@ -41,4 +41,4 @@
 
 }  // namespace aos
 
-#endif  // _AOS_COMMON_SCOPED_FD_
+#endif  // _AOS_SCOPED_FD_
diff --git a/aos/common/scoped_ptr.h b/aos/scoped/scoped_ptr.h
similarity index 83%
rename from aos/common/scoped_ptr.h
rename to aos/scoped/scoped_ptr.h
index e4df78e..336e73b 100644
--- a/aos/common/scoped_ptr.h
+++ b/aos/scoped/scoped_ptr.h
@@ -1,7 +1,7 @@
-#ifndef AOS_COMMON_SCOPED_PTR_H_
-#define AOS_COMMON_SCOPED_PTR_H_
+#ifndef AOS_SCOPED_PTR_H_
+#define AOS_SCOPED_PTR_H_
 
-#include "aos/common/macros.h"
+#include "aos/macros.h"
 
 namespace aos {
 
@@ -40,4 +40,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_SCOPED_PTR_H_
+#endif  // AOS_SCOPED_PTR_H_
diff --git a/aos/stl_mutex/BUILD b/aos/stl_mutex/BUILD
new file mode 100644
index 0000000..a9b7957
--- /dev/null
+++ b/aos/stl_mutex/BUILD
@@ -0,0 +1,26 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "stl_mutex",
+    hdrs = [
+        "stl_mutex.h",
+    ],
+    deps = [
+        "//aos/logging",
+        "//aos/linux_code/ipc_lib:aos_sync",
+    ],
+)
+
+cc_test(
+    name = "stl_mutex_test",
+    srcs = [
+        "stl_mutex_test.cc",
+    ],
+    deps = [
+        "//aos:die",
+        ":stl_mutex",
+        "//aos/util:thread",
+        "//aos/testing:googletest",
+        "//aos/testing:test_logging",
+    ],
+)
diff --git a/aos/common/stl_mutex.h b/aos/stl_mutex/stl_mutex.h
similarity index 94%
rename from aos/common/stl_mutex.h
rename to aos/stl_mutex/stl_mutex.h
index 9242312..a5ac807 100644
--- a/aos/common/stl_mutex.h
+++ b/aos/stl_mutex/stl_mutex.h
@@ -1,12 +1,12 @@
-#ifndef AOS_COMMON_STL_MUTEX_H_
-#define AOS_COMMON_STL_MUTEX_H_
+#ifndef AOS_STL_MUTEX_H_
+#define AOS_STL_MUTEX_H_
 
 #include <mutex>
 
 #include "aos/linux_code/ipc_lib/aos_sync.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/type_traits.h"
-#include "aos/common/macros.h"
+#include "aos/logging/logging.h"
+#include "aos/type_traits/type_traits.h"
+#include "aos/macros.h"
 
 namespace aos {
 
@@ -141,4 +141,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_STL_MUTEX_H_
+#endif  // AOS_STL_MUTEX_H_
diff --git a/aos/common/stl_mutex_test.cc b/aos/stl_mutex/stl_mutex_test.cc
similarity index 93%
rename from aos/common/stl_mutex_test.cc
rename to aos/stl_mutex/stl_mutex_test.cc
index 236f506..36d7067 100644
--- a/aos/common/stl_mutex_test.cc
+++ b/aos/stl_mutex/stl_mutex_test.cc
@@ -1,10 +1,10 @@
-#include "aos/common/stl_mutex.h"
+#include "aos/stl_mutex/stl_mutex.h"
 
 #include "gtest/gtest.h"
 
 #include "aos/testing/test_logging.h"
-#include "aos/common/util/thread.h"
-#include "aos/common/die.h"
+#include "aos/util/thread.h"
+#include "aos/die.h"
 
 namespace aos {
 namespace testing {
diff --git a/aos/common/test_queue.q b/aos/test_queue.q
similarity index 100%
rename from aos/common/test_queue.q
rename to aos/test_queue.q
diff --git a/aos/testing/BUILD b/aos/testing/BUILD
index 93cd4bb..4d1b6a4 100644
--- a/aos/testing/BUILD
+++ b/aos/testing/BUILD
@@ -26,8 +26,8 @@
     deps = [
         ":googletest",
         "//aos:once",
-        "//aos/common:mutex",
-        "//aos/common/logging:implementations",
+        "//aos/mutex:mutex",
+        "//aos/logging:implementations",
     ],
 )
 
@@ -39,7 +39,7 @@
     deps = [
         ":googletest",
         ":test_logging",
-        "//aos/common/logging",
+        "//aos/logging",
     ],
 )
 
@@ -54,7 +54,7 @@
     ],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/common/logging",
+        "//aos/logging",
     ],
 )
 
@@ -70,8 +70,8 @@
     visibility = ["//visibility:public"],
     deps = [
         ":test_logging",
-        "//aos/common:queues",
-        "//aos/common/logging",
+        "//aos:queues",
+        "//aos/logging",
         "//aos/linux_code/ipc_lib:shared_mem",
     ],
 )
diff --git a/aos/testing/prevent_exit.cc b/aos/testing/prevent_exit.cc
index 93d7c58..3190698 100644
--- a/aos/testing/prevent_exit.cc
+++ b/aos/testing/prevent_exit.cc
@@ -3,7 +3,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace testing {
diff --git a/aos/testing/test_logging.cc b/aos/testing/test_logging.cc
index 617f02a..34af54d 100644
--- a/aos/testing/test_logging.cc
+++ b/aos/testing/test_logging.cc
@@ -6,8 +6,8 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/logging/implementations.h"
-#include "aos/common/mutex.h"
+#include "aos/logging/implementations.h"
+#include "aos/mutex/mutex.h"
 #include "aos/once.h"
 
 using ::aos::logging::LogMessage;
diff --git a/aos/testing/test_logging_test.cc b/aos/testing/test_logging_test.cc
index 369f94d..9dd6eba 100644
--- a/aos/testing/test_logging_test.cc
+++ b/aos/testing/test_logging_test.cc
@@ -4,7 +4,7 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace testing {
diff --git a/aos/testing/test_shm.cc b/aos/testing/test_shm.cc
index 92c3924..f7ddfcb 100644
--- a/aos/testing/test_shm.cc
+++ b/aos/testing/test_shm.cc
@@ -2,8 +2,8 @@
 
 #include <sys/mman.h>
 
-#include "aos/common/queue.h"
-#include "aos/common/logging/logging.h"
+#include "aos/queue.h"
+#include "aos/logging/logging.h"
 #include "aos/testing/test_logging.h"
 
 namespace aos {
diff --git a/aos/time/BUILD b/aos/time/BUILD
new file mode 100644
index 0000000..cbeeb5b
--- /dev/null
+++ b/aos/time/BUILD
@@ -0,0 +1,33 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "time",
+    srcs = [
+        "time.cc",
+    ],
+    hdrs = [
+        "time.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+    deps = [
+        "//aos:macros",
+        "//aos/mutex:mutex",
+        "//aos/logging",
+        "//aos/linux_code/ipc_lib:shared_mem",
+    ],
+)
+
+cc_test(
+    name = "time_test",
+    srcs = [
+        "time_test.cc",
+    ],
+    deps = [
+        ":time",
+        "//aos/logging",
+        "//aos/util:death_test_log_implementation",
+        "//aos/testing:googletest",
+    ],
+)
diff --git a/aos/common/time.cc b/aos/time/time.cc
similarity index 97%
rename from aos/common/time.cc
rename to aos/time/time.cc
index 0fe3ee3..a72b121 100644
--- a/aos/common/time.cc
+++ b/aos/time/time.cc
@@ -1,4 +1,4 @@
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 
 #include <inttypes.h>
 #include <string.h>
@@ -10,8 +10,8 @@
 // dependency on it.
 #include "aos/linux_code/ipc_lib/shared_mem.h"
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/mutex.h"
+#include "aos/logging/logging.h"
+#include "aos/mutex/mutex.h"
 
 namespace chrono = ::std::chrono;
 
diff --git a/aos/common/time.h b/aos/time/time.h
similarity index 94%
rename from aos/common/time.h
rename to aos/time/time.h
index fe0bd5f..9bef741 100644
--- a/aos/common/time.h
+++ b/aos/time/time.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_TIME_H_
-#define AOS_COMMON_TIME_H_
+#ifndef AOS_TIME_H_
+#define AOS_TIME_H_
 
 #include <stdint.h>
 #include <time.h>
@@ -11,8 +11,8 @@
 #include <thread>
 #include <ostream>
 
-#include "aos/common/type_traits.h"
-#include "aos/common/macros.h"
+#include "aos/type_traits/type_traits.h"
+#include "aos/macros.h"
 
 namespace aos {
 
@@ -99,4 +99,4 @@
 }  // namespace std
 
 
-#endif  // AOS_COMMON_TIME_H_
+#endif  // AOS_TIME_H_
diff --git a/aos/common/time_test.cc b/aos/time/time_test.cc
similarity index 92%
rename from aos/common/time_test.cc
rename to aos/time/time_test.cc
index 14e049e..7b6c1a5 100644
--- a/aos/common/time_test.cc
+++ b/aos/time/time_test.cc
@@ -1,11 +1,11 @@
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 
 #include <thread>
 
 #include "gtest/gtest.h"
 
-#include "aos/common/macros.h"
-#include "aos/common/util/death_test_log_implementation.h"
+#include "aos/macros.h"
+#include "aos/util/death_test_log_implementation.h"
 
 namespace aos {
 namespace time {
diff --git a/aos/transaction/BUILD b/aos/transaction/BUILD
new file mode 100644
index 0000000..3d5a29f
--- /dev/null
+++ b/aos/transaction/BUILD
@@ -0,0 +1,26 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "transaction",
+    hdrs = [
+        "transaction.h",
+    ],
+    deps = [
+        "//aos/logging",
+        "//aos/util:compiler_memory_barrier",
+    ],
+)
+
+cc_test(
+    name = "transaction_test",
+    srcs = [
+        "transaction_test.cc",
+    ],
+    deps = [
+        ":transaction",
+        "//aos/logging",
+        "//aos/util:death_test_log_implementation",
+        "//aos/testing:googletest",
+    ],
+)
+
diff --git a/aos/common/transaction.h b/aos/transaction/transaction.h
similarity index 93%
rename from aos/common/transaction.h
rename to aos/transaction/transaction.h
index e6e9e41..f1c5c02 100644
--- a/aos/common/transaction.h
+++ b/aos/transaction/transaction.h
@@ -1,12 +1,12 @@
-#ifndef AOS_COMMON_TRANSACTION_H_
-#define AOS_COMMON_TRANSACTION_H_
+#ifndef AOS_TRANSACTION_H_
+#define AOS_TRANSACTION_H_
 
 #include <stdint.h>
 
 #include <array>
 
-#include "aos/common/util/compiler_memory_barrier.h"
-#include "aos/common/logging/logging.h"
+#include "aos/util/compiler_memory_barrier.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace transaction {
@@ -100,4 +100,4 @@
 }  // namespace transaction
 }  // namespace aos
 
-#endif  // AOS_COMMON_TRANSACTION_H_
+#endif  // AOS_TRANSACTION_H_
diff --git a/aos/common/transaction_test.cc b/aos/transaction/transaction_test.cc
similarity index 96%
rename from aos/common/transaction_test.cc
rename to aos/transaction/transaction_test.cc
index e74fd69..f7551c8 100644
--- a/aos/common/transaction_test.cc
+++ b/aos/transaction/transaction_test.cc
@@ -1,10 +1,10 @@
-#include "aos/common/transaction.h"
+#include "aos/transaction/transaction.h"
 
 #include <vector>
 
 #include "gtest/gtest.h"
 
-#include "aos/common/util/death_test_log_implementation.h"
+#include "aos/util/death_test_log_implementation.h"
 
 namespace aos {
 namespace transaction {
diff --git a/aos/type_traits/BUILD b/aos/type_traits/BUILD
new file mode 100644
index 0000000..3a5198e
--- /dev/null
+++ b/aos/type_traits/BUILD
@@ -0,0 +1,22 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "type_traits",
+    hdrs = [
+        "type_traits.h",
+    ],
+    compatible_with = [
+        "//tools:armhf-debian",
+    ],
+)
+
+cc_test(
+    name = "type_traits_test",
+    srcs = [
+        "type_traits_test.cpp",
+    ],
+    deps = [
+        ":type_traits",
+        "//aos/testing:googletest",
+    ],
+)
diff --git a/aos/common/type_traits.h b/aos/type_traits/type_traits.h
similarity index 95%
rename from aos/common/type_traits.h
rename to aos/type_traits/type_traits.h
index 229e574..f0a2e72 100644
--- a/aos/common/type_traits.h
+++ b/aos/type_traits/type_traits.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_TYPE_TRAITS_
-#define AOS_COMMON_TYPE_TRAITS_
+#ifndef AOS_TYPE_TRAITS_
+#define AOS_TYPE_TRAITS_
 
 #include <features.h>
 
diff --git a/aos/common/type_traits_test.cpp b/aos/type_traits/type_traits_test.cpp
similarity index 97%
rename from aos/common/type_traits_test.cpp
rename to aos/type_traits/type_traits_test.cpp
index aa104ee..4c060bb 100644
--- a/aos/common/type_traits_test.cpp
+++ b/aos/type_traits/type_traits_test.cpp
@@ -1,4 +1,4 @@
-#include "aos/common/type_traits.h"
+#include "aos/type_traits/type_traits.h"
 
 #include "gtest/gtest.h"
 
diff --git a/aos/common/unique_malloc_ptr.h b/aos/unique_malloc_ptr.h
similarity index 100%
rename from aos/common/unique_malloc_ptr.h
rename to aos/unique_malloc_ptr.h
diff --git a/aos/common/util/BUILD b/aos/util/BUILD
similarity index 87%
rename from aos/common/util/BUILD
rename to aos/util/BUILD
index 0f2ca73..70f23c4 100644
--- a/aos/common/util/BUILD
+++ b/aos/util/BUILD
@@ -19,7 +19,7 @@
         "run_command.h",
     ],
     deps = [
-        "//aos/common/logging",
+        "//aos/logging",
     ],
 )
 
@@ -31,7 +31,7 @@
     deps = [
         ":run_command",
         ":thread",
-        "//aos/common/logging",
+        "//aos/logging",
         "//aos/testing:googletest",
     ],
 )
@@ -42,7 +42,7 @@
         "death_test_log_implementation.h",
     ],
     deps = [
-        "//aos/common/logging:implementations",
+        "//aos/logging:implementations",
     ],
 )
 
@@ -55,8 +55,8 @@
         "inet_addr.h",
     ],
     deps = [
-        "//aos/common:byteorder",
-        "//aos/common:network_port",
+        "//aos:byteorder",
+        "//aos:network_port",
     ],
 )
 
@@ -69,8 +69,8 @@
         "phased_loop.h",
     ],
     deps = [
-        "//aos/common:time",
-        "//aos/common/logging",
+        "//aos/time:time",
+        "//aos/logging",
     ],
 )
 
@@ -80,8 +80,8 @@
         "log_interval.h",
     ],
     deps = [
-        "//aos/common:time",
-        "//aos/common/logging",
+        "//aos/time:time",
+        "//aos/logging",
     ],
 )
 
@@ -115,8 +115,8 @@
         "thread.h",
     ],
     deps = [
-        "//aos/common:macros",
-        "//aos/common/logging",
+        "//aos:macros",
+        "//aos/logging",
     ],
 )
 
@@ -132,8 +132,8 @@
         "-lm",
     ],
     deps = [
-        "//aos/common:time",
-        "//aos/common/logging",
+        "//aos/time:time",
+        "//aos/logging",
         "//third_party/eigen",
     ],
 )
@@ -225,7 +225,7 @@
         "linked_list.h",
     ],
     deps = [
-        "//aos/common:transaction",
+        "//aos/transaction:transaction",
     ],
 )
 
@@ -236,7 +236,7 @@
     ],
     deps = [
         ":linked_list",
-        "//aos/common/logging",
+        "//aos/logging",
         "//aos/testing:googletest",
     ],
 )
@@ -262,7 +262,7 @@
         "file.h",
     ],
     deps = [
-        "//aos/common:scoped_fd",
+        "//aos/scoped:scoped_fd",
     ],
 )
 
@@ -283,5 +283,5 @@
     name = "python_init",
     srcs = ["__init__.py"],
     visibility = ["//visibility:public"],
-    deps = ["//aos/common:python_init"],
+    deps = ["//aos:python_init"],
 )
diff --git a/aos/common/util/__init__.py b/aos/util/__init__.py
similarity index 100%
rename from aos/common/util/__init__.py
rename to aos/util/__init__.py
diff --git a/aos/common/util/compiler_memory_barrier.h b/aos/util/compiler_memory_barrier.h
similarity index 62%
rename from aos/common/util/compiler_memory_barrier.h
rename to aos/util/compiler_memory_barrier.h
index 5126941..33da511 100644
--- a/aos/common/util/compiler_memory_barrier.h
+++ b/aos/util/compiler_memory_barrier.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_UTIL_COMPILER_MEMORY_BARRIER_H_
-#define AOS_COMMON_UTIL_COMPILER_MEMORY_BARRIER_H_
+#ifndef AOS_UTIL_COMPILER_MEMORY_BARRIER_H_
+#define AOS_UTIL_COMPILER_MEMORY_BARRIER_H_
 
 // Prevents the compiler from reordering memory operations around this.
 // Using this function makes it clearer what you're doing and easier to be
@@ -8,4 +8,4 @@
   __asm__ __volatile__("" ::: "memory");
 }
 
-#endif  // AOS_COMMON_UTIL_COMPILER_MEMORY_BARRIER_H_
+#endif  // AOS_UTIL_COMPILER_MEMORY_BARRIER_H_
diff --git a/aos/common/util/death_test_log_implementation.h b/aos/util/death_test_log_implementation.h
similarity index 73%
rename from aos/common/util/death_test_log_implementation.h
rename to aos/util/death_test_log_implementation.h
index c1b1da2..f061c61 100644
--- a/aos/common/util/death_test_log_implementation.h
+++ b/aos/util/death_test_log_implementation.h
@@ -1,9 +1,9 @@
-#ifndef AOS_COMMON_UTIL_DEATH_TEST_LOG_IMPLEMENTATION_H_
-#define AOS_COMMON_UTIL_DEATH_TEST_LOG_IMPLEMENTATION_H_
+#ifndef AOS_UTIL_DEATH_TEST_LOG_IMPLEMENTATION_H_
+#define AOS_UTIL_DEATH_TEST_LOG_IMPLEMENTATION_H_
 
 #include <stdlib.h>
 
-#include "aos/common/logging/implementations.h"
+#include "aos/logging/implementations.h"
 
 namespace aos {
 namespace util {
@@ -24,4 +24,4 @@
 }  // namespace util
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_DEATH_TEST_LOG_IMPLEMENTATION_H_
+#endif  // AOS_UTIL_DEATH_TEST_LOG_IMPLEMENTATION_H_
diff --git a/aos/common/util/file.cc b/aos/util/file.cc
similarity index 88%
rename from aos/common/util/file.cc
rename to aos/util/file.cc
index 4c859cf..dc31ddd 100644
--- a/aos/common/util/file.cc
+++ b/aos/util/file.cc
@@ -1,9 +1,9 @@
-#include "aos/common/util/file.h"
+#include "aos/util/file.h"
 
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "aos/common/scoped_fd.h"
+#include "aos/scoped/scoped_fd.h"
 
 namespace aos {
 namespace util {
diff --git a/aos/common/util/file.h b/aos/util/file.h
similarity index 72%
rename from aos/common/util/file.h
rename to aos/util/file.h
index a32d0a7..0c1f11f 100644
--- a/aos/common/util/file.h
+++ b/aos/util/file.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_UTIL_FILE_H_
-#define AOS_COMMON_UTIL_FILE_H_
+#ifndef AOS_UTIL_FILE_H_
+#define AOS_UTIL_FILE_H_
 
 #include <string>
 
@@ -13,4 +13,4 @@
 }  // namespace util
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_FILE_H_
+#endif  // AOS_UTIL_FILE_H_
diff --git a/aos/common/util/file_test.cc b/aos/util/file_test.cc
similarity index 96%
rename from aos/common/util/file_test.cc
rename to aos/util/file_test.cc
index 12a4976..f904259 100644
--- a/aos/common/util/file_test.cc
+++ b/aos/util/file_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util/file.h"
+#include "aos/util/file.h"
 
 #include <stdlib.h>
 
diff --git a/aos/common/util/global_factory.h b/aos/util/global_factory.h
similarity index 95%
rename from aos/common/util/global_factory.h
rename to aos/util/global_factory.h
index aac49bb..5e47972 100644
--- a/aos/common/util/global_factory.h
+++ b/aos/util/global_factory.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_UTIL_GLOBAL_FACTORY_H_
-#define AOS_COMMON_UTIL_GLOBAL_FACTORY_H_
+#ifndef AOS_UTIL_GLOBAL_FACTORY_H_
+#define AOS_UTIL_GLOBAL_FACTORY_H_
 
 #include <functional>
 #include <memory>
@@ -90,4 +90,4 @@
 
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_GLOBAL_FACTORY_H_
+#endif  // AOS_UTIL_GLOBAL_FACTORY_H_
diff --git a/aos/common/util/global_factory_test.cc b/aos/util/global_factory_test.cc
similarity index 96%
rename from aos/common/util/global_factory_test.cc
rename to aos/util/global_factory_test.cc
index 8da7dcb..d50e931 100644
--- a/aos/common/util/global_factory_test.cc
+++ b/aos/util/global_factory_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util/global_factory.h"
+#include "aos/util/global_factory.h"
 #include "gtest/gtest.h"
 
 namespace aos {
diff --git a/aos/common/util/inet_addr.cc b/aos/util/inet_addr.cc
similarity index 91%
rename from aos/common/util/inet_addr.cc
rename to aos/util/inet_addr.cc
index 48bde1d..edb7dbb 100644
--- a/aos/common/util/inet_addr.cc
+++ b/aos/util/inet_addr.cc
@@ -1,10 +1,10 @@
-#include "aos/common/util/inet_addr.h"
+#include "aos/util/inet_addr.h"
 
 #include <stdlib.h>
 #ifndef __VXWORKS__
 #include <string.h>
 
-#include "aos/common/byteorder.h"
+#include "aos/byteorder.h"
 #else
 
 template<typename T>
diff --git a/aos/common/util/inet_addr.h b/aos/util/inet_addr.h
similarity index 78%
rename from aos/common/util/inet_addr.h
rename to aos/util/inet_addr.h
index 35368f1..dc2d613 100644
--- a/aos/common/util/inet_addr.h
+++ b/aos/util/inet_addr.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_UTIL_INET_ADDR_H_
-#define AOS_COMMON_UTIL_INET_ADDR_H_
+#ifndef AOS_UTIL_INET_ADDR_H_
+#define AOS_UTIL_INET_ADDR_H_
 
 #ifdef __VXWORKS__
 #include <inetLib.h>
@@ -9,7 +9,7 @@
 #include <arpa/inet.h>
 #endif
 
-#include "aos/common/network_port.h"
+#include "aos/network_port.h"
 
 namespace aos {
 namespace util {
@@ -26,4 +26,4 @@
 }  // namespace util
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_INET_ADDR_H_
+#endif  // AOS_UTIL_INET_ADDR_H_
diff --git a/aos/common/util/linked_list.h b/aos/util/linked_list.h
similarity index 94%
rename from aos/common/util/linked_list.h
rename to aos/util/linked_list.h
index 5821389..5a5824e 100644
--- a/aos/common/util/linked_list.h
+++ b/aos/util/linked_list.h
@@ -1,9 +1,9 @@
-#ifndef AOS_COMMON_UTIL_LINKED_LIST_H_
-#define AOS_COMMON_UTIL_LINKED_LIST_H_
+#ifndef AOS_UTIL_LINKED_LIST_H_
+#define AOS_UTIL_LINKED_LIST_H_
 
 #include <functional>
 
-#include "aos/common/transaction.h"
+#include "aos/transaction/transaction.h"
 
 namespace aos {
 namespace util {
@@ -110,4 +110,4 @@
 }  // namespace util
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_LINKED_LIST_H_
+#endif  // AOS_UTIL_LINKED_LIST_H_
diff --git a/aos/common/util/linked_list_test.cc b/aos/util/linked_list_test.cc
similarity index 98%
rename from aos/common/util/linked_list_test.cc
rename to aos/util/linked_list_test.cc
index 0f4b2c8..6959628 100644
--- a/aos/common/util/linked_list_test.cc
+++ b/aos/util/linked_list_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util/linked_list.h"
+#include "aos/util/linked_list.h"
 
 #include <vector>
 
diff --git a/aos/common/util/log_interval.h b/aos/util/log_interval.h
similarity index 92%
rename from aos/common/util/log_interval.h
rename to aos/util/log_interval.h
index 8823341..5e76166 100644
--- a/aos/common/util/log_interval.h
+++ b/aos/util/log_interval.h
@@ -1,8 +1,8 @@
-#ifndef AOS_COMMON_UTIL_LOG_INTERVAL_H_
-#define AOS_COMMON_UTIL_LOG_INTERVAL_H_
+#ifndef AOS_UTIL_LOG_INTERVAL_H_
+#define AOS_UTIL_LOG_INTERVAL_H_
 
-#include "aos/common/time.h"
-#include "aos/common/logging/logging.h"
+#include "aos/time/time.h"
+#include "aos/logging/logging.h"
 
 #include <string>
 
@@ -94,4 +94,4 @@
 }  // namespace util
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_LOG_INTERVAL_H_
+#endif  // AOS_UTIL_LOG_INTERVAL_H_
diff --git a/aos/common/util/options.h b/aos/util/options.h
similarity index 95%
rename from aos/common/util/options.h
rename to aos/util/options.h
index 48c4fd8..39f7e8f 100644
--- a/aos/common/util/options.h
+++ b/aos/util/options.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_UTIL_OPTIONS_H_
-#define AOS_COMMON_UTIL_OPTIONS_H_
+#ifndef AOS_UTIL_OPTIONS_H_
+#define AOS_UTIL_OPTIONS_H_
 
 #include <sys/types.h>
 
@@ -89,4 +89,4 @@
 
 }  // namespace options
 
-#endif  // AOS_COMMON_UTIL_OPTIONS_H_
+#endif  // AOS_UTIL_OPTIONS_H_
diff --git a/aos/common/util/options_test.cc b/aos/util/options_test.cc
similarity index 97%
rename from aos/common/util/options_test.cc
rename to aos/util/options_test.cc
index 197340c..ee228cb 100644
--- a/aos/common/util/options_test.cc
+++ b/aos/util/options_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util/options.h"
+#include "aos/util/options.h"
 
 #include "gtest/gtest.h"
 
diff --git a/aos/common/util/phased_loop.cc b/aos/util/phased_loop.cc
similarity index 94%
rename from aos/common/util/phased_loop.cc
rename to aos/util/phased_loop.cc
index 5382df2..a349718 100644
--- a/aos/common/util/phased_loop.cc
+++ b/aos/util/phased_loop.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util/phased_loop.h"
+#include "aos/util/phased_loop.h"
 
 namespace aos {
 namespace time {
diff --git a/aos/common/util/phased_loop.h b/aos/util/phased_loop.h
similarity index 93%
rename from aos/common/util/phased_loop.h
rename to aos/util/phased_loop.h
index 958bd01..1c1aef1 100644
--- a/aos/common/util/phased_loop.h
+++ b/aos/util/phased_loop.h
@@ -1,9 +1,9 @@
-#ifndef AOS_COMMON_UTIL_PHASED_LOOP_H_
-#define AOS_COMMON_UTIL_PHASED_LOOP_H_
+#ifndef AOS_UTIL_PHASED_LOOP_H_
+#define AOS_UTIL_PHASED_LOOP_H_
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace time {
@@ -85,4 +85,4 @@
 }  // namespace time
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_PHASED_LOOP_H_
+#endif  // AOS_UTIL_PHASED_LOOP_H_
diff --git a/aos/common/util/phased_loop_test.cc b/aos/util/phased_loop_test.cc
similarity index 99%
rename from aos/common/util/phased_loop_test.cc
rename to aos/util/phased_loop_test.cc
index b9d6e52..2a52b90 100644
--- a/aos/common/util/phased_loop_test.cc
+++ b/aos/util/phased_loop_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util/phased_loop.h"
+#include "aos/util/phased_loop.h"
 
 #include "gtest/gtest.h"
 
diff --git a/aos/common/util/run_command.cc b/aos/util/run_command.cc
similarity index 95%
rename from aos/common/util/run_command.cc
rename to aos/util/run_command.cc
index a4a19d8..2b08cb2 100644
--- a/aos/common/util/run_command.cc
+++ b/aos/util/run_command.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util/run_command.h"
+#include "aos/util/run_command.h"
 
 #include <signal.h>
 #include <sys/types.h>
@@ -7,7 +7,7 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace util {
diff --git a/aos/common/util/run_command.h b/aos/util/run_command.h
similarity index 75%
rename from aos/common/util/run_command.h
rename to aos/util/run_command.h
index d116481..02c6785 100644
--- a/aos/common/util/run_command.h
+++ b/aos/util/run_command.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_UTIL_RUN_COMMAND_H_
-#define AOS_COMMON_UTIL_RUN_COMMAND_H_
+#ifndef AOS_UTIL_RUN_COMMAND_H_
+#define AOS_UTIL_RUN_COMMAND_H_
 
 namespace aos {
 namespace util {
@@ -14,4 +14,4 @@
 }  // namespace util
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_RUN_COMMAND_H_
+#endif  // AOS_UTIL_RUN_COMMAND_H_
diff --git a/aos/common/util/run_command_test.cc b/aos/util/run_command_test.cc
similarity index 94%
rename from aos/common/util/run_command_test.cc
rename to aos/util/run_command_test.cc
index daff3c5..775b716 100644
--- a/aos/common/util/run_command_test.cc
+++ b/aos/util/run_command_test.cc
@@ -1,8 +1,8 @@
-#include "aos/common/util/run_command.h"
+#include "aos/util/run_command.h"
 
 #include "gtest/gtest.h"
 
-#include "aos/common/util/thread.h"
+#include "aos/util/thread.h"
 
 namespace aos {
 namespace util {
diff --git a/aos/common/util/string_to_num.h b/aos/util/string_to_num.h
similarity index 86%
rename from aos/common/util/string_to_num.h
rename to aos/util/string_to_num.h
index d99ed91..86210ca 100644
--- a/aos/common/util/string_to_num.h
+++ b/aos/util/string_to_num.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_UTIL_STRING_TO_NUM_H_
-#define AOS_COMMON_UTIL_STRING_TO_NUM_H_
+#ifndef AOS_UTIL_STRING_TO_NUM_H_
+#define AOS_UTIL_STRING_TO_NUM_H_
 
 #include <sstream>
 #include <string>
diff --git a/aos/common/util/string_to_num_test.cc b/aos/util/string_to_num_test.cc
similarity index 95%
rename from aos/common/util/string_to_num_test.cc
rename to aos/util/string_to_num_test.cc
index df3897a..3f467cf 100644
--- a/aos/common/util/string_to_num_test.cc
+++ b/aos/util/string_to_num_test.cc
@@ -4,7 +4,7 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/util/string_to_num.h"
+#include "aos/util/string_to_num.h"
 
 namespace aos {
 namespace util {
diff --git a/aos/common/util/thread.cc b/aos/util/thread.cc
similarity index 95%
rename from aos/common/util/thread.cc
rename to aos/util/thread.cc
index 54a8ef2..6b3ef76 100644
--- a/aos/common/util/thread.cc
+++ b/aos/util/thread.cc
@@ -1,9 +1,9 @@
-#include "aos/common/util/thread.h"
+#include "aos/util/thread.h"
 
 #include <pthread.h>
 #include <signal.h>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace util {
diff --git a/aos/common/util/thread.h b/aos/util/thread.h
similarity index 93%
rename from aos/common/util/thread.h
rename to aos/util/thread.h
index 993e343..5992810 100644
--- a/aos/common/util/thread.h
+++ b/aos/util/thread.h
@@ -1,12 +1,12 @@
-#ifndef AOS_COMMON_UTIL_THREAD_H_
-#define AOS_COMMON_UTIL_THREAD_H_
+#ifndef AOS_UTIL_THREAD_H_
+#define AOS_UTIL_THREAD_H_
 
 #include <functional>
 #include <atomic>
 
 #include <pthread.h>
 
-#include "aos/common/macros.h"
+#include "aos/macros.h"
 
 namespace aos {
 namespace util {
@@ -87,4 +87,4 @@
 }  // namespace util
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_THREAD_H_
+#endif  // AOS_UTIL_THREAD_H_
diff --git a/aos/common/util/trapezoid_profile.cc b/aos/util/trapezoid_profile.cc
similarity index 97%
rename from aos/common/util/trapezoid_profile.cc
rename to aos/util/trapezoid_profile.cc
index 4e4546e..e58324f 100644
--- a/aos/common/util/trapezoid_profile.cc
+++ b/aos/util/trapezoid_profile.cc
@@ -1,6 +1,6 @@
-#include "aos/common/util/trapezoid_profile.h"
+#include "aos/util/trapezoid_profile.h"
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 using ::Eigen::Matrix;
 
diff --git a/aos/common/util/trapezoid_profile.h b/aos/util/trapezoid_profile.h
similarity index 90%
rename from aos/common/util/trapezoid_profile.h
rename to aos/util/trapezoid_profile.h
index cc91db1..944c423 100644
--- a/aos/common/util/trapezoid_profile.h
+++ b/aos/util/trapezoid_profile.h
@@ -1,10 +1,10 @@
-#ifndef AOS_COMMON_UTIL_TRAPEZOID_PROFILE_H_
-#define AOS_COMMON_UTIL_TRAPEZOID_PROFILE_H_
+#ifndef AOS_UTIL_TRAPEZOID_PROFILE_H_
+#define AOS_UTIL_TRAPEZOID_PROFILE_H_
 
 #include "Eigen/Dense"
 
-#include "aos/common/macros.h"
-#include "aos/common/time.h"
+#include "aos/macros.h"
+#include "aos/time/time.h"
 
 namespace aos {
 namespace util {
@@ -66,4 +66,4 @@
 }  // namespace util
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_TRAPEZOID_PROFILE_H_
+#endif  // AOS_UTIL_TRAPEZOID_PROFILE_H_
diff --git a/aos/common/util/trapezoid_profile.py b/aos/util/trapezoid_profile.py
similarity index 100%
rename from aos/common/util/trapezoid_profile.py
rename to aos/util/trapezoid_profile.py
diff --git a/aos/common/util/trapezoid_profile_test.cc b/aos/util/trapezoid_profile_test.cc
similarity index 98%
rename from aos/common/util/trapezoid_profile_test.cc
rename to aos/util/trapezoid_profile_test.cc
index f9ae817..79795e1 100644
--- a/aos/common/util/trapezoid_profile_test.cc
+++ b/aos/util/trapezoid_profile_test.cc
@@ -2,7 +2,7 @@
 
 #include "Eigen/Dense"
 
-#include "aos/common/util/trapezoid_profile.h"
+#include "aos/util/trapezoid_profile.h"
 
 namespace aos {
 namespace util {
diff --git a/aos/common/util/wrapping_counter.cc b/aos/util/wrapping_counter.cc
similarity index 88%
rename from aos/common/util/wrapping_counter.cc
rename to aos/util/wrapping_counter.cc
index 61f5047..f98d7e3 100644
--- a/aos/common/util/wrapping_counter.cc
+++ b/aos/util/wrapping_counter.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util/wrapping_counter.h"
+#include "aos/util/wrapping_counter.h"
 
 namespace aos {
 namespace util {
diff --git a/aos/common/util/wrapping_counter.h b/aos/util/wrapping_counter.h
similarity index 84%
rename from aos/common/util/wrapping_counter.h
rename to aos/util/wrapping_counter.h
index fbf3611..a327dd8 100644
--- a/aos/common/util/wrapping_counter.h
+++ b/aos/util/wrapping_counter.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_UTIL_WRAPPING_COUNTER_H_
-#define AOS_COMMON_UTIL_WRAPPING_COUNTER_H_
+#ifndef AOS_UTIL_WRAPPING_COUNTER_H_
+#define AOS_UTIL_WRAPPING_COUNTER_H_
 
 #include <stdint.h>
 
@@ -31,4 +31,4 @@
 }  // namespace util
 }  // namespace aos
 
-#endif  // AOS_COMMON_UTIL_WRAPPING_COUNTER_H_
+#endif  // AOS_UTIL_WRAPPING_COUNTER_H_
diff --git a/aos/common/util/wrapping_counter_test.cc b/aos/util/wrapping_counter_test.cc
similarity index 96%
rename from aos/common/util/wrapping_counter_test.cc
rename to aos/util/wrapping_counter_test.cc
index e257fb0..e5c58f3 100644
--- a/aos/common/util/wrapping_counter_test.cc
+++ b/aos/util/wrapping_counter_test.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util/wrapping_counter.h"
+#include "aos/util/wrapping_counter.h"
 
 #include <limits.h>
 
diff --git a/aos/vision/blob/BUILD b/aos/vision/blob/BUILD
index e1255c8..bc1e7f0 100644
--- a/aos/vision/blob/BUILD
+++ b/aos/vision/blob/BUILD
@@ -25,7 +25,7 @@
         "//tools:armhf-debian",
     ],
     deps = [
-        "//aos/common/logging",
+        "//aos/logging",
     ],
 )
 
diff --git a/aos/vision/blob/region_alloc.h b/aos/vision/blob/region_alloc.h
index 4bc4156..8c7bc57 100644
--- a/aos/vision/blob/region_alloc.h
+++ b/aos/vision/blob/region_alloc.h
@@ -9,7 +9,7 @@
 #include <utility>
 #include <vector>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace vision {
diff --git a/aos/vision/debug/BUILD b/aos/vision/debug/BUILD
index 06f5d0b..bb03a75 100644
--- a/aos/vision/debug/BUILD
+++ b/aos/vision/debug/BUILD
@@ -43,9 +43,9 @@
         "//tools:armhf-debian",
     ],
     deps = [
-        "//aos/common/logging",
-        "//aos/common/logging:implementations",
-        "//aos/common/util:global_factory",
+        "//aos/logging",
+        "//aos/logging:implementations",
+        "//aos/util:global_factory",
         "//aos/vision/blob:codec",
         "//aos/vision/blob:find_blob",
         "//aos/vision/blob:range_image",
diff --git a/aos/vision/debug/debug_framework.cc b/aos/vision/debug/debug_framework.cc
index d4ba0d2..46f5400 100644
--- a/aos/vision/debug/debug_framework.cc
+++ b/aos/vision/debug/debug_framework.cc
@@ -2,8 +2,8 @@
 
 #include <gtk/gtk.h>
 
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/logging.h"
 #include "aos/vision/blob/find_blob.h"
 #include "aos/vision/blob/stream_view.h"
 #include "aos/vision/events/epoll_events.h"
diff --git a/aos/vision/debug/debug_framework.h b/aos/vision/debug/debug_framework.h
index e838913..d5b345f 100644
--- a/aos/vision/debug/debug_framework.h
+++ b/aos/vision/debug/debug_framework.h
@@ -1,7 +1,7 @@
 #ifndef _AOS_VISION_DEBUG_DEBUG_FRAMEWORK_H_
 #define _AOS_VISION_DEBUG_DEBUG_FRAMEWORK_H_
 
-#include "aos/common/util/global_factory.h"
+#include "aos/util/global_factory.h"
 #include "aos/vision/blob/range_image.h"
 #include "aos/vision/events/epoll_events.h"
 #include "aos/vision/image/camera_params.pb.h"
diff --git a/aos/vision/events/BUILD b/aos/vision/events/BUILD
index b3affc2..359822c 100644
--- a/aos/vision/events/BUILD
+++ b/aos/vision/events/BUILD
@@ -10,9 +10,9 @@
         "//tools:armhf-debian",
     ],
     deps = [
-        "//aos/common:scoped_fd",
-        "//aos/common:time",
-        "//aos/common/logging",
+        "//aos/scoped:scoped_fd",
+        "//aos/time:time",
+        "//aos/logging",
     ],
 )
 
@@ -68,8 +68,8 @@
         "//tools:armhf-debian",
     ],
     deps = [
-        "//aos/common:macros",
-        "//aos/common:scoped_fd",
+        "//aos:macros",
+        "//aos/scoped:scoped_fd",
     ],
 )
 
diff --git a/aos/vision/events/epoll_events.cc b/aos/vision/events/epoll_events.cc
index b0c66fa..0043b78 100644
--- a/aos/vision/events/epoll_events.cc
+++ b/aos/vision/events/epoll_events.cc
@@ -7,7 +7,7 @@
 #include <sys/types.h>
 #include <vector>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace events {
diff --git a/aos/vision/events/epoll_events.h b/aos/vision/events/epoll_events.h
index 234d949..19851ed 100644
--- a/aos/vision/events/epoll_events.h
+++ b/aos/vision/events/epoll_events.h
@@ -7,8 +7,8 @@
 #include <vector>
 #include <sys/epoll.h>
 
-#include "aos/common/scoped_fd.h"
-#include "aos/common/time.h"
+#include "aos/scoped/scoped_fd.h"
+#include "aos/time/time.h"
 
 namespace aos {
 namespace events {
diff --git a/aos/vision/events/tcp_client.cc b/aos/vision/events/tcp_client.cc
index 4ac45af..8e197ec 100644
--- a/aos/vision/events/tcp_client.cc
+++ b/aos/vision/events/tcp_client.cc
@@ -13,7 +13,7 @@
 #include <unistd.h>
 #include <unistd.h>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace events {
diff --git a/aos/vision/events/tcp_server.cc b/aos/vision/events/tcp_server.cc
index 06f3a41..0fd7225 100644
--- a/aos/vision/events/tcp_server.cc
+++ b/aos/vision/events/tcp_server.cc
@@ -13,7 +13,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace events {
diff --git a/aos/vision/events/udp.cc b/aos/vision/events/udp.cc
index 660342c..ed39db9 100644
--- a/aos/vision/events/udp.cc
+++ b/aos/vision/events/udp.cc
@@ -2,7 +2,7 @@
 
 #include <string.h>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace events {
diff --git a/aos/vision/events/udp.h b/aos/vision/events/udp.h
index 9a23dab..503ead1 100644
--- a/aos/vision/events/udp.h
+++ b/aos/vision/events/udp.h
@@ -8,8 +8,8 @@
 #include <string>
 #include <vector>
 
-#include "aos/common/macros.h"
-#include "aos/common/scoped_fd.h"
+#include "aos/macros.h"
+#include "aos/scoped/scoped_fd.h"
 
 namespace aos {
 namespace events {
diff --git a/aos/vision/image/BUILD b/aos/vision/image/BUILD
index 8409ea5..39c40d6 100644
--- a/aos/vision/image/BUILD
+++ b/aos/vision/image/BUILD
@@ -9,7 +9,7 @@
         "//tools:armhf-debian",
     ],
     deps = [
-        "//aos/common/logging",
+        "//aos/logging",
     ],
 )
 
@@ -34,8 +34,8 @@
     deps = [
         ":camera_params",
         ":image_types",
-        "//aos/common:time",
-        "//aos/common/logging",
+        "//aos/time:time",
+        "//aos/logging",
     ],
 )
 
@@ -48,7 +48,7 @@
     ],
     deps = [
         ":image_types",
-        "//aos/common/logging",
+        "//aos/logging",
         "//third_party/libjpeg",
     ],
 )
diff --git a/aos/vision/image/image_types.h b/aos/vision/image/image_types.h
index f8e5e65..d4ddbf2 100644
--- a/aos/vision/image/image_types.h
+++ b/aos/vision/image/image_types.h
@@ -7,7 +7,7 @@
 #include <sstream>
 
 #include <experimental/string_view>
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace aos {
 namespace vision {
diff --git a/aos/vision/image/jpeg_routines.cc b/aos/vision/image/jpeg_routines.cc
index b6be41b..237daff 100644
--- a/aos/vision/image/jpeg_routines.cc
+++ b/aos/vision/image/jpeg_routines.cc
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <cstring>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "third_party/libjpeg/jpeglib.h"
 
 namespace aos {
diff --git a/aos/vision/image/reader.cc b/aos/vision/image/reader.cc
index 57766e2..aaf9a10 100644
--- a/aos/vision/image/reader.cc
+++ b/aos/vision/image/reader.cc
@@ -12,8 +12,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/time.h"
+#include "aos/logging/logging.h"
+#include "aos/time/time.h"
 
 #define CLEAR(x) memset(&(x), 0, sizeof(x))
 
diff --git a/aos/vision/image/reader.h b/aos/vision/image/reader.h
index e913ad1..adb3a3c 100644
--- a/aos/vision/image/reader.h
+++ b/aos/vision/image/reader.h
@@ -5,7 +5,7 @@
 #include <functional>
 #include <string>
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 #include "aos/vision/image/V4L2.h"
 #include "aos/vision/image/camera_params.pb.h"
 #include "aos/vision/image/image_types.h"
diff --git a/aos/vision/tools/BUILD b/aos/vision/tools/BUILD
index 09c2d55..c4119e8 100644
--- a/aos/vision/tools/BUILD
+++ b/aos/vision/tools/BUILD
@@ -3,8 +3,8 @@
 gtk_dependent_cc_binary(name = "jpeg_vision_test",
   srcs = ["jpeg_vision_test.cc"],
   deps = [
-    "//aos/common/logging:logging",
-    "//aos/common/logging:implementations",
+    "//aos/logging:logging",
+    "//aos/logging:implementations",
     "//aos/vision/math:vector",
     "//aos/vision/image:reader",
     "//aos/vision/image:jpeg_routines",
@@ -22,8 +22,8 @@
   name = 'camera_primer',
   srcs = ['camera_primer.cc'],
   deps = [
-    '//aos/common/logging:logging',
-    '//aos/common/logging:implementations',
+    '//aos/logging:logging',
+    '//aos/logging:implementations',
     '//aos/vision/image:image_stream',
     '//aos/vision/events:epoll_events',
   ],
diff --git a/aos/vision/tools/camera_primer.cc b/aos/vision/tools/camera_primer.cc
index 3ba24bc..1ac96fd 100644
--- a/aos/vision/tools/camera_primer.cc
+++ b/aos/vision/tools/camera_primer.cc
@@ -1,5 +1,5 @@
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/logging.h"
 #include "aos/vision/events/epoll_events.h"
 #include "aos/vision/image/image_stream.h"
 
diff --git a/aos/vision/tools/jpeg_vision_test.cc b/aos/vision/tools/jpeg_vision_test.cc
index 059166e..072b57b 100644
--- a/aos/vision/tools/jpeg_vision_test.cc
+++ b/aos/vision/tools/jpeg_vision_test.cc
@@ -12,8 +12,8 @@
 #include <memory>
 #include <vector>
 
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/logging.h"
 #include "aos/vision/blob/range_image.h"
 #include "aos/vision/blob/stream_view.h"
 #include "aos/vision/blob/threshold.h"
diff --git a/debian/BUILD b/debian/BUILD
index a052657..7ab6705 100644
--- a/debian/BUILD
+++ b/debian/BUILD
@@ -36,6 +36,10 @@
     ":arm_frc_gnueabi_deps.bzl",
     arm_frc_gnueabi_deps_debs = "files",
 )
+load(
+    ":python_gtk.bzl",
+    python_gtk_debs = "files",
+)
 load("//debian:packages.bzl", "download_packages", "generate_deb_tarball")
 
 filegroup(
@@ -46,6 +50,30 @@
     visibility = ["@matplotlib//:__pkg__"],
 )
 
+filegroup(
+    name = "python_shapely_patches",
+    srcs = [
+        "python_shapely_init.patch",
+    ],
+    visibility = ["@python_gtk//:__pkg__"],
+)
+
+filegroup(
+    name = "python_gi_patches",
+    srcs = [
+        "python_gi_init.patch",
+    ],
+    visibility = ["@python_gtk//:__pkg__"],
+)
+
+filegroup(
+    name = "python_geos_patches",
+    srcs = [
+        "python_geos.patch",
+    ],
+    visibility = ["@python_gtk//:__pkg__"],
+)
+
 py_binary(
     name = "download_packages",
     srcs = [
@@ -143,6 +171,7 @@
     ],
     packages = [
         "python-matplotlib",
+        "python-tk",
         "python3-matplotlib",
     ],
 )
@@ -164,6 +193,25 @@
     ],
 )
 
+download_packages(
+    name = "download_python_gtk_deps",
+    excludes = [
+        "fonts-freefont",
+        "gsettings-backend",
+        "libpng-dev",
+        "libz-dev",
+        "python3-dev",
+        "python3",
+    ],
+    packages = [
+        "libgtk-3-dev",
+        "python3-cairo",
+        "python3-gi",
+        "python3-gi-cairo",
+        "python3-shapely",
+    ],
+)
+
 generate_deb_tarball(
     name = "python",
     files = python_debs,
@@ -208,3 +256,8 @@
     name = "arm_frc_gnueabi_deps",
     files = arm_frc_gnueabi_deps_debs,
 )
+
+generate_deb_tarball(
+    name = "python_gtk",
+    files = python_gtk_debs,
+)
diff --git a/debian/matplotlib.BUILD b/debian/matplotlib.BUILD
index 208761a..5f89ba9 100644
--- a/debian/matplotlib.BUILD
+++ b/debian/matplotlib.BUILD
@@ -25,16 +25,18 @@
 
 _data_files = glob([
     "usr/share/matplotlib/mpl-data/**",
+    "usr/share/tcltk/**",
 ])
 
 _src_copied = ["/".join(f.split("/")[4:]) for f in _src_files]
 
 _builtin_so_files = glob([
     "usr/lib/python2.7/dist-packages/**/*.x86_64-linux-gnu.so",
+    "usr/lib/python2.7/lib-dynload/*.so",
 ])
 
 _system_so_files = glob([
-    "usr/lib/x86_64-linux-gnu/**/*.so*",
+    "usr/lib/**/*.so*",
     "lib/x86_64-linux-gnu/**/*.so*",
 ])
 
@@ -45,6 +47,7 @@
 _builtin_rpaths = [":".join([
     "\\$$ORIGIN/%s" % rel,
     "\\$$ORIGIN/%s/rpathed/usr/lib/x86_64-linux-gnu" % rel,
+    "\\$$ORIGIN/%s/rpathed/usr/lib" % rel,
     "\\$$ORIGIN/%s/rpathed/lib/x86_64-linux-gnu" % rel,
 ]) for rel in ["/".join([".." for _ in so.split("/")[1:]]) for so in _builtin_so_copied]]
 
@@ -96,9 +99,15 @@
 )
 
 genrule(
-    name = "create_empty_rc",
+    name = "create_rc",
     outs = ["usr/share/matplotlib/mpl-data/matplotlibrc"],
-    cmd = "touch $@",
+    cmd = "\n".join([
+        "cat > $@ << END",
+        # This is necessary to make matplotlib actually plot things to the
+        # screen by default.
+        "backend      : TkAgg",
+        "END",
+    ]),
 )
 
 py_library(
diff --git a/debian/matplotlib.bzl b/debian/matplotlib.bzl
index d54ba56..8e441d6 100644
--- a/debian/matplotlib.bzl
+++ b/debian/matplotlib.bzl
@@ -1,4 +1,5 @@
 files = {
+    "blt_2.5.3+dfsg-1_amd64.deb": "0a66841fa4f764fa504f3921b7566a85234859e552ce2a2d599a10a10f2ea7c4",
     "coreutils_8.23-4_amd64.deb": "6d3764c746887015c88c684aecc14dd1317eefeb76ba2acdf59d9ad5e4d97236",
     "fontconfig-config_2.11.0-6.3+deb8u1_all.deb": "f7963c0338fd031101f3f684a4e37306eefcd05094220947dd9cb7388a2fe85f",
     "fontconfig_2.11.0-6.3+deb8u1_amd64.deb": "5383eabf18c4c3dc3d581d1efea0e6ccbfd2c08a6a98cd3e6c491b1a99759375",
@@ -33,14 +34,14 @@
     "libthai0_0.1.21-1_amd64.deb": "992e35bf8c1685ba1cb439a99a78db72c7960075cb25cf3175d67f782cbb75c3",
     "libtiff5_4.0.3-12.3+deb8u6_amd64.deb": "73f4e28cd270d59698feb45564fb73329eef645c645218420d600d7e13115b84",
     "libtk8.6_8.6.2-1_amd64.deb": "c8bf4cffca2af331cd323c88e68ac1e90f48b08de24813f6b24308b18977d396",
-    "libx11-6_1.6.2-3+deb8u1_amd64.deb": "380aa38372e949f74b57e962146626aae847850ed4f1fcb83784086f239d50c3",
-    "libx11-data_1.6.2-3+deb8u1_all.deb": "4879a3054d6508e86f737bf668737c3fc64980c3512b2912f18bceea823e1899",
+    "libx11-6_1.6.2-3+deb8u2_amd64.deb": "aac2335619b5a9ebabfd2be2d63d9f6791faf15993dc54abafde1fdf74297174",
+    "libx11-data_1.6.2-3+deb8u2_all.deb": "8b5c2679ca7ddee702ef58f2d31e7176bc7d08d648089a3b0ac48d51ec8f10e1",
     "libxau6_1.0.8-1_amd64.deb": "b03b2d0d400c2002a2d38300bd6630306abb0ff325c3d4a4447ecceb58335228",
     "libxcb-render0_1.10-3+b1_amd64.deb": "1277261ed3b901d70b01901836b2f6d89235dd6777636f3f26b5d2979f1c7e22",
     "libxcb-shm0_1.10-3+b1_amd64.deb": "724749f2ea6a471ba353f6a93585bf98577c2103648297fac40c46b9a08671b0",
     "libxcb1_1.10-3+b1_amd64.deb": "07bf131f4f0f8a9f1a023ab88cce3a1d12cc7222d3c7f08f00b60a3699af5188",
     "libxcomposite1_0.4.4-1_amd64.deb": "ff739711c5aa6df107fdfb6e13491e8317b2c45477d91a6b17da5660cd8ca8f4",
-    "libxcursor1_1.1.14-1+deb8u1_amd64.deb": "31c05ccd419d5c255643e3d21c871204e154a06af25300c2bd2b721989d038f0",
+    "libxcursor1_1.1.14-1+deb8u2_amd64.deb": "011d069b9bf6604c19c1d07dc7214b24a8fea6dfbb6748fb1fd90532c855c00b",
     "libxdamage1_1.1.4-2+b1_amd64.deb": "c2b13deaa87dbad7d541e29755464f125409b9d4d038d6982bb9f8f35939b817",
     "libxdmcp6_1.1.1-1+b1_amd64.deb": "6758bc820616254634fdd2354a2691e40d2973d6bf3a9c12417f02770f75081c",
     "libxext6_1.3.3-1_amd64.deb": "5105f77289a7e08faaf3bb4c16c6945cafca65b9bdb4792fef820045ab43e568",
@@ -48,7 +49,7 @@
     "libxft2_2.3.2-1_amd64.deb": "38d6013c0b6305caf38932e6274108d81b2b2df0dd67f04987aa3f69c1e6677e",
     "libxi6_1.7.4-1+deb8u1_amd64.deb": "a99de627a07f54bc40e5dc77e3ca7e9d9b5619e068f1bb303f86edd138d6d037",
     "libxinerama1_1.1.3-1+b1_amd64.deb": "3668c1178ac649879338192759e79879e0f5797764b448dcac6aed4b24ef495b",
-    "libxml2_2.9.1+dfsg1-5+deb8u6_amd64.deb": "23c9e795d10443baf09fce7bcc007790f9c19597313fab3ff9691f7100fd0419",
+    "libxml2_2.9.1+dfsg1-5+deb8u7_amd64.deb": "34dcf3dc64e65935fa9e31ba9aa5d1795ed054f17203f01255a1875e55435f70",
     "libxrandr2_1.4.2-1+deb8u1_amd64.deb": "e59996ac0e993331799aa7bc768f7edd7b0baec0fafdbeebeef658834ba96b63",
     "libxrender1_0.9.8-1+b1_amd64.deb": "8980934c84c0ebbca4158023d91ced3ddbfa028a2be25959ff4566b37eceb8f4",
     "libxss1_1.2.2-1_amd64.deb": "0f2fc4eff464b63a4fafed9ab2e499e1804dcee85c5d9a89e53c3ed6a2a06b88",
@@ -60,6 +61,7 @@
     "python-pkg-resources_5.5.1-1_all.deb": "a6d6963f9a1943aee463356e462f7f5283938da6e810940514c1b6c8b8496595",
     "python-pyparsing_2.0.3+dfsg1-1_all.deb": "b8051ce4e3108f52c9ee6137ce5c2175ac64a81782a3249dbfe1f75e409e5978",
     "python-six_1.8.0-1_all.deb": "15e635be0154af9232cb30b10df8c598a274a9b55bbe5c0355aff51cc1e63e88",
+    "python-tk_2.7.8-2+b1_amd64.deb": "cc0e861c75984698874d62dbb23fbf67259364cfe7430bf872196758bdf68632",
     "python-tz_2012c+dfsg-0.1_all.deb": "cb240ad52f4f5e225b7366fab31257664a7b2a50d1bf339c3cd9fdcf0b9e34f6",
     "python3-dateutil_2.2-2_all.deb": "f64d71bddfe4d8ee3ec602495605f79b36c217e61192a35fe2f168f63cea2006",
     "python3-matplotlib_1.4.2-3.1_amd64.deb": "38314c38dcef9332b5b76b32f4207bb0e84188f21ca8e4df5cc2e7895e08b0c8",
@@ -70,6 +72,7 @@
     "python3-tz_2012c+dfsg-0.1_all.deb": "add2d6e1afd92c106d61d09854316ccab73931442b54298df0269899ee9a834c",
     "python_2.7.9-1_amd64.deb": "93dc9d03df366d658832fb238a6c1e6c57e5e57dd648145c2f57a8f3e2b419ed",
     "shared-mime-info_1.3-1_amd64.deb": "50c122e36f96e5cc808c6b7528ebd27f8086783e2c5b7c39ac7f6da6f62b09c1",
+    "tk8.6-blt2.5_2.5.3+dfsg-1_amd64.deb": "805970b3b4fca2f413852651ad249697d2ad4edd7402201e910d231094db6184",
     "ttf-bitstream-vera_1.10-8_all.deb": "328def7f581bf94b3b06d21e641f3e5df9a9b2e84e93b4206bc952fe8e80f38a",
     "tzdata_2018e-0+deb8u1_all.deb": "124fe7da8988d0779be3c1883e7de00742ed46464f5f94616d5222cd16f9537a",
     "ucf_3.0030_all.deb": "1b93d9fc5930b9d8382705b71605e07fe11f4796db239b7ac2644bf4fbd7f6a2",
diff --git a/debian/matplotlib_init.patch b/debian/matplotlib_init.patch
index 11a3ad8..0106b64 100644
--- a/debian/matplotlib_init.patch
+++ b/debian/matplotlib_init.patch
@@ -8,16 +8,16 @@
  import six
  import sys
  import distutils.version
-@@ -110,6 +111,21 @@
+@@ -110,6 +111,26 @@
  __version__ = str('1.4.2')
  __version__numpy__ = str('1.6')  # minimum required numpy version
  
-+matplotlib_base = os.path.dirname(os.path.dirname(__file__))
++_matplotlib_base = os.path.dirname(os.path.dirname(__file__))
 +
 +# Hack to point matplotlib at its data.
 +os.environ['MATPLOTLIBDATA'] = \
 +        os.path.join( \
-+            matplotlib_base,
++            _matplotlib_base,
 +            "usr", "share", "matplotlib", "mpl-data")
 +# Avoid reading /etc/matplotlib in all cases. Matplotlib is pretty happy to
 +# escape the sandbox by using absolute paths.
@@ -27,6 +27,11 @@
 +# manually here to work around the bug.
 +os.environ['MPLCONFIGDIR'] = '/tmp/matplotlib-nobody'
 +
++# Tell Tcl where to find the sandboxed version. Otherwise, it will try using
++# one from the host system, even if that's an incompatible version.
++os.environ['TCL_LIBRARY'] = os.path.join(_matplotlib_base, 'usr', 'share',
++                                         'tcltk', 'tcl8.6')
++
  try:
      import dateutil
  except ImportError:
diff --git a/debian/python_geos.patch b/debian/python_geos.patch
new file mode 100644
index 0000000..9fd697a
--- /dev/null
+++ b/debian/python_geos.patch
@@ -0,0 +1,14 @@
+--- a/geos.py	2018-10-17 23:02:05.000000000 -0700
++++ b/geos.py	2018-10-17 23:16:33.017257372 -0700
+@@ -40,6 +40,11 @@ def load_dll(libname, fallbacks=None):
+             return CDLL(lib)
+         except OSError:
+             pass
++        base = os.path.dirname(os.path.dirname(__file__))
++        try:
++            return CDLL(os.path.join(base, 'rpathed', 'usr', 'lib', lib))
++        except OSError:
++            pass
+     if fallbacks is not None:
+         for name in fallbacks:
+             try:
diff --git a/debian/python_gi_init.patch b/debian/python_gi_init.patch
new file mode 100644
index 0000000..97ca2dc
--- /dev/null
+++ b/debian/python_gi_init.patch
@@ -0,0 +1,14 @@
+--- a/__init__.py	1969-12-31 16:00:00.000000000 -0800
++++ b/__init__.py	2018-10-17 21:45:04.908201161 -0700
+@@ -29,6 +29,11 @@ import os
+ import importlib
+ import types
+ 
++_base = os.path.dirname(os.path.dirname(__file__))
++os.environ['GI_TYPELIB_PATH'] = os.path.join(_base, 'usr', 'lib',
++                                             'x86_64-linux-gnu',
++                                             'girepository-1.0')
++
+ _static_binding_error = ('When using gi.repository you must not import static '
+                          'modules like "gobject". Please change all occurrences '
+                          'of "import gobject" to "from gi.repository import GObject". '
diff --git a/debian/python_gtk.BUILD b/debian/python_gtk.BUILD
new file mode 100644
index 0000000..367c137
--- /dev/null
+++ b/debian/python_gtk.BUILD
@@ -0,0 +1,163 @@
+genrule(
+    name = "patch_gi_init",
+    srcs = [
+        "usr/lib/python3/dist-packages/gi/__init__.py",
+        "@//debian:python_gi_patches",
+    ],
+    outs = ["gi/__init__.py"],
+    cmd = " && ".join([
+        "cp $(location usr/lib/python3/dist-packages/gi/__init__.py) $@",
+        "readonly PATCH=\"$$(readlink -f $(location @patch))\"",
+        "readonly FILE=\"$$(readlink -f $(location @//debian:python_gi_patches))\"",
+        "(cd $(@D) && \"$${PATCH}\" -p1 < \"$${FILE}\") > /dev/null",
+    ]),
+    tools = [
+        "@patch",
+    ],
+)
+
+genrule(
+    name = "patch_shapely_init",
+    srcs = [
+        "usr/lib/python3/dist-packages/shapely/__init__.py",
+        "@//debian:python_shapely_patches",
+    ],
+    outs = ["shapely/__init__.py"],
+    cmd = " && ".join([
+        "cp $(location usr/lib/python3/dist-packages/shapely/__init__.py) $@",
+        "readonly PATCH=\"$$(readlink -f $(location @patch))\"",
+        "readonly FILE=\"$$(readlink -f $(location @//debian:python_shapely_patches))\"",
+        "(cd $(@D) && \"$${PATCH}\" -p1 < \"$${FILE}\") > /dev/null",
+    ]),
+    tools = [
+        "@patch",
+    ],
+)
+
+genrule(
+    name = "patch_geos",
+    srcs = [
+        "usr/lib/python3/dist-packages/shapely/geos.py",
+        "@//debian:python_geos_patches",
+    ],
+    outs = ["shapely/geos.py"],
+    cmd = " && ".join([
+        "cp $(location usr/lib/python3/dist-packages/shapely/geos.py) $@",
+        "readonly PATCH=\"$$(readlink -f $(location @patch))\"",
+        "readonly FILE=\"$$(readlink -f $(location @//debian:python_geos_patches))\"",
+        "(cd $(@D) && \"$${PATCH}\" -p1 < \"$${FILE}\") > /dev/null",
+    ]),
+    tools = [
+        "@patch",
+    ],
+)
+
+_src_files = glob(
+    include = ["usr/lib/python3/dist-packages/**/*.py"],
+    exclude = [
+        "usr/lib/python3/dist-packages/gi/__init__.py",
+        "usr/lib/python3/dist-packages/shapely/__init__.py",
+        "usr/lib/python3/dist-packages/shapely/geos.py",
+    ],
+)
+
+_data_files = glob([
+    "usr/lib/x86_64-linux-gnu/girepository-1.0/**/*",
+])
+
+_src_copied = ["/".join(f.split("/")[4:]) for f in _src_files]
+
+_builtin_so_files = glob([
+    "usr/lib/python3/dist-packages/**/*.cpython-34m-x86_64-linux-gnu.so",
+])
+
+_system_so_files = glob(
+    include = [
+        "lib/x86_64-linux-gnu/**/*.so*",
+        "usr/lib/**/*.so*",
+    ],
+    exclude = [
+        "usr/lib/**/*.cpython-34m-x86_64-linux-gnu.so",
+    ],
+)
+
+_builtin_so_copied = ["/".join(f.split("/")[4:]) for f in _builtin_so_files]
+
+_system_so_copied = ["rpathed/" + f for f in _system_so_files]
+
+_builtin_rpaths = [":".join([
+    "\\$$ORIGIN/%s" % rel,
+    "\\$$ORIGIN/%s/rpathed/usr/lib/x86_64-linux-gnu" % rel,
+    "\\$$ORIGIN/%s/rpathed/usr/lib" % rel,
+    "\\$$ORIGIN/%s/rpathed/lib/x86_64-linux-gnu" % rel,
+]) for rel in ["/".join([".." for _ in so.split("/")[1:]]) for so in _builtin_so_copied]]
+
+_system_rpaths = [":".join([
+    "\\$$ORIGIN/%s/rpathed/usr/lib/x86_64-linux-gnu" % rel,
+    "\\$$ORIGIN/%s/rpathed/usr/lib" % rel,
+    "\\$$ORIGIN/%s/rpathed/lib/x86_64-linux-gnu" % rel,
+]) for rel in ["/".join([".." for _ in so.split("/")[1:]]) for so in _system_so_copied]]
+
+genrule(
+    name = "run_patchelf_builtin",
+    srcs = _builtin_so_files,
+    outs = _builtin_so_copied,
+    cmd = "\n".join(
+        [
+            "cp $(location %s) $(location %s)" % (src, dest)
+            for src, dest in zip(_builtin_so_files, _builtin_so_copied)
+        ] +
+        ["$(location @patchelf) --set-rpath %s $(location %s)" % (rpath, so) for rpath, so in zip(_builtin_rpaths, _builtin_so_copied)],
+    ),
+    tools = [
+        "@patchelf",
+    ],
+)
+
+genrule(
+    name = "run_patchelf_system",
+    srcs = _system_so_files,
+    outs = _system_so_copied,
+    cmd = "\n".join(
+        [
+            "cp $(location %s) $(location %s)" % (src, dest)
+            for src, dest in zip(_system_so_files, _system_so_copied)
+        ] +
+        ["$(location @patchelf) --set-rpath %s $(location %s)" % (rpath, so) for rpath, so in zip(_system_rpaths, _system_so_copied)],
+    ),
+    tools = [
+        "@patchelf",
+    ],
+)
+
+genrule(
+    name = "copy_libgeos_c",
+    srcs = ["rpathed/usr/lib/libgeos_c.so.1"],
+    outs = ["rpathed/usr/lib/libgeos_c.so"],
+    cmd = "cp $< $@",
+)
+
+genrule(
+    name = "copy_files",
+    srcs = _src_files,
+    outs = _src_copied,
+    cmd = " && ".join(["cp $(location %s) $(location %s)" % (src, dest) for src, dest in zip(
+        _src_files,
+        _src_copied,
+    )]),
+)
+
+py_library(
+    name = "python_gtk",
+    srcs = _src_copied + [
+        "gi/__init__.py",
+        "shapely/__init__.py",
+        "shapely/geos.py",
+    ],
+    data = _data_files + _builtin_so_copied + _system_so_copied + [
+        "rpathed/usr/lib/libgeos_c.so",
+    ],
+    imports = ["usr/lib/python3/dist-packages"],
+    restricted_to = ["@//tools:k8"],
+    visibility = ["//visibility:public"],
+)
diff --git a/debian/python_gtk.bzl b/debian/python_gtk.bzl
new file mode 100644
index 0000000..18aa84b
--- /dev/null
+++ b/debian/python_gtk.bzl
@@ -0,0 +1,203 @@
+files = {
+    "adduser_3.113+nmu3_all.deb": "ae69ab0da5c36e48ba38e27c5e0886d6a67988adead5e5324b9b90736d37c11e",
+    "adwaita-icon-theme_3.14.0-2_all.deb": "3be4a0849080371cb26091128fe90c7541eb4b7e4f97c03a23b26f6748e8352a",
+    "coreutils_8.23-4_amd64.deb": "6d3764c746887015c88c684aecc14dd1317eefeb76ba2acdf59d9ad5e4d97236",
+    "dbus_1.8.22-0+deb8u1_amd64.deb": "d3fef69b6697ad9ac5400524f704736d986d701fa0f4b6d92b43521ad38f5d9e",
+    "dconf-gsettings-backend_0.22.0-1_amd64.deb": "38212d8e4ef3106d3f3f147c2fab9b601d2173fa76f12a85a0d9d2e3487752e9",
+    "dconf-service_0.22.0-1_amd64.deb": "14c4eeee6b2f43fe21a3189a2aa6cc5d5b25aea99bd1000db620f48dcc05566f",
+    "debianutils_4.4+b1_amd64.deb": "3d18d183b79d259e0ca77d65904c55810d70443743967c77f1a0aebf2dd94fb1",
+    "fontconfig-config_2.11.0-6.3+deb8u1_all.deb": "f7963c0338fd031101f3f684a4e37306eefcd05094220947dd9cb7388a2fe85f",
+    "fontconfig_2.11.0-6.3+deb8u1_amd64.deb": "5383eabf18c4c3dc3d581d1efea0e6ccbfd2c08a6a98cd3e6c491b1a99759375",
+    "fonts-dejavu-core_2.34-1_all.deb": "002c9fa9445cfec4964637f22c73265d8a868f0810104452a6c906af52e43dab",
+    "fonts-liberation_1.07.4-1_all.deb": "5490dd0b745bae9aa0c9a31ab75597229042d8fb45910ebbc21fe04f0cb1b87b",
+    "gir1.2-atk-1.0_2.14.0-1_amd64.deb": "cd172ac38313cc615cc0ebea71f6491a1db6e4ee676a717ae4d70731b331d4a5",
+    "gir1.2-atspi-2.0_2.14.0-1_amd64.deb": "b4601bc884526c8ce4319bc3eb2269f2ae7f68d8a0c6f6fad131fe728c84c95a",
+    "gir1.2-freedesktop_1.42.0-2.2_amd64.deb": "810d66b5d11aa6cb951f19c569ff664e86a15db70ad0f5d0ebecd5f0bdcb75bf",
+    "gir1.2-gdkpixbuf-2.0_2.31.1-2+deb8u7_amd64.deb": "324887a6ea94d8b040fb3633e95fafd2de73b454780573c29b479c1e10ad664c",
+    "gir1.2-glib-2.0_1.42.0-2.2_amd64.deb": "cf7e97331bbc7bb4807e1a622f24681afc4ddd9e2d7e9f693c91a48c6ccc6d3c",
+    "gir1.2-gtk-3.0_3.14.5-1+deb8u1_amd64.deb": "9a9a06a32ce79d2b083031fa8548e004acee55ae0e092afc8a0a1b99ef8cbd9f",
+    "gir1.2-pango-1.0_1.36.8-3_amd64.deb": "33366c4abd9cc201de7724d7711928b9e153f1df88831d59fd2fd34ecf81a36f",
+    "glib-networking-common_2.42.0-2_all.deb": "f58923eeaea87db676343e7cb12e624b07df5f2fdfc0873051e4d1c1f309b4a4",
+    "glib-networking-services_2.42.0-2_amd64.deb": "5bae064daca2f6ac6e74ad0f2dbef867592a3652854884d136ee1d2dcdb511a3",
+    "glib-networking_2.42.0-2_amd64.deb": "aa6684a52e562f65c4974ecdd3c21a9ac92310dd575ef86e05d02107dd708c7f",
+    "gsettings-desktop-schemas_3.14.1-1_all.deb": "723ba6cc41e3e655a129c4b877016d792de083a46534e24754b9baf6ae7f6964",
+    "hicolor-icon-theme_0.13-1_all.deb": "f95a3a55833356285026543d663a6c2e91c1b6adc463bae38e79350021eba32a",
+    "libatk-bridge2.0-0_2.14.0-2_amd64.deb": "5a3eb5b006531726a78df46486414b5afa1bb17dd6f0adbd638d098b05224292",
+    "libatk-bridge2.0-dev_2.14.0-2_amd64.deb": "7f8ee97f9ec4c67f393ff16ee0d94f7414139c1b192e3e100adefad16570d792",
+    "libatk1.0-0_2.14.0-1_amd64.deb": "3c09c360031a4d251b294557ac3dd4365150c1bffd522b4a78ba9d93f6d3ab26",
+    "libatk1.0-data_2.14.0-1_all.deb": "fd3d0906bdb08b9d8db9458f29b3c24640ca56669d30d82b9db7c9d1abaf2535",
+    "libatk1.0-dev_2.14.0-1_amd64.deb": "23c5ce230d87d240d34e635120bfc3a970f36e749c39cbe11a6cbeefd41b47b8",
+    "libatspi2.0-0_2.14.0-1_amd64.deb": "9970b3b9c30d2dd0173c31e8fd12f4ad0cdacb9d5144420dc2d2b7bf1e36a86b",
+    "libatspi2.0-dev_2.14.0-1_amd64.deb": "7a3c8a946b64d6e6b10455b40ab0e5aaa42f280ae25f042b9c39f0d015425e2d",
+    "libaudit-common_2.4-1_all.deb": "be7f873c8f149b53b8cc3c337b067050d18208cb0de3f8cf6114a29bd20a17e3",
+    "libaudit1_2.4-1+b1_amd64.deb": "c51ba54837876bc5bb95688be5321303e7fbcbb384d3038797a22933bb87ef6d",
+    "libavahi-client3_0.6.31-5_amd64.deb": "cd0bf1b525606f38de14b50f88b841177b967273015968a13aa3d848d69729aa",
+    "libavahi-common-data_0.6.31-5_amd64.deb": "8366634609f3c4985c7ee01a1d68a9733d3dc6b54831437d8bad9d11f667c639",
+    "libavahi-common3_0.6.31-5_amd64.deb": "83bc43e646989a3f39684cf331b8fc15b009f54b88eeeb9c0851c20f4cc25310",
+    "libcairo-gobject2_1.14.0-2.1+deb8u2_amd64.deb": "4525b089a91d65841a0967981e69640c34f8d41a59c07501d78675a4a3fb6225",
+    "libcairo-script-interpreter2_1.14.0-2.1+deb8u2_amd64.deb": "449a7fd62a7ceb950407751756592c1f1ba5fbf94b8f9859cedf2a3f353a25ea",
+    "libcairo2-dev_1.14.0-2.1+deb8u2_amd64.deb": "ecbdb19124e7185a8f76cd2a4d94c232bb906ae807d32b8b6cae080d6b0f76bf",
+    "libcairo2_1.14.0-2.1+deb8u2_amd64.deb": "5bb8028434e2ecbc75734bb7bd8ebc1f2f4d824834820c09729fd713b67ca0fe",
+    "libcap-ng0_0.7.4-2_amd64.deb": "9aab7cfa0ab5136d161fb5fd2a2e230657bee1e9f6e8e3348b2a94e8271dae81",
+    "libcolord2_1.2.1-1+b2_amd64.deb": "7721d763a8adbb9710f9ba8d55a3b4ae1f92934e2803ff739edb106c11d154a0",
+    "libcomerr2_1.42.12-2+b1_amd64.deb": "a6dadf0f224dcbb2826b074fa393ffae0903fed67cd3338007abf40dad02b233",
+    "libcroco3_0.6.8-3+b1_amd64.deb": "330941dbd4b3ff90cc4625c980e41e2d7447c284d0b4734393b80f7597a37c72",
+    "libcups2_1.7.5-11+deb8u4_amd64.deb": "3b8a0320c839c2f7afaff039f9687a24fbaf0a892e0e16c644ef5256f6960366",
+    "libdatrie1_0.2.8-1_amd64.deb": "8f1c9f4acaaa7cbe8b742c16d3b7c261c42193ceefef927cdefeccfc2b92348d",
+    "libdbus-1-3_1.8.22-0+deb8u1_amd64.deb": "5902cf8264fe4630832bf88704fadf9f48c57cc64a3aee8db03aa123d89492ca",
+    "libdbus-1-dev_1.8.22-0+deb8u1_amd64.deb": "1a9fa1055f6854378ea71aed4dc692b9c8a7c6099ed196af67535269dc010af6",
+    "libdbus-glib-1-2_0.102-1_amd64.deb": "ad01b2c41185a9f52d61eaf838553b3bc3c2059ee1b4eb33e2c14774770b8d76",
+    "libdbus-glib-1-dev_0.102-1_amd64.deb": "4c80699b5d863cffac0342acd171ac422ca22f4b4e4b3e050d5e0fd177817d39",
+    "libdconf1_0.22.0-1_amd64.deb": "0dc9757a8c7da4ad22dfef8607b144f75c9285f60127c67ab9b231da6d170a3b",
+    "libelfg0_0.8.13-5_amd64.deb": "cc36aeebc762776df6b911fd224afcfb1b0e34d7f4773a2ebf3fc2f1b7fc8533",
+    "libfontconfig1-dev_2.11.0-6.3+deb8u1_amd64.deb": "480f95e5023ca3f1f57d9436395985c6a61d7cc7e13c6fa9e908147382c6450e",
+    "libfontconfig1_2.11.0-6.3+deb8u1_amd64.deb": "0bb54d61c13aa5b5253cb5e08aaca0dfc4c626a05ee30f51d0e3002cda166fec",
+    "libfreetype6-dev_2.5.2-3+deb8u2_amd64.deb": "b98c911209fc521e6be867cfca74af9653a5e990fc0542dd1c2497fa67aa77aa",
+    "libfreetype6_2.5.2-3+deb8u2_amd64.deb": "58e384796f31cd582e6da200fad74d09f5aad968eb7a45c5c2fa202675660b46",
+    "libgcrypt20_1.6.3-2+deb8u5_amd64.deb": "c452ebd74685eeebb2e5b00b76839b145c540209de3354f345b31443ed7b7a0c",
+    "libgdk-pixbuf2.0-0_2.31.1-2+deb8u7_amd64.deb": "eba768ee4828f41df9eaae59fc90b72ad215497b0bb6b7618202e93a35a8aab8",
+    "libgdk-pixbuf2.0-common_2.31.1-2+deb8u7_all.deb": "04cf3a42d105483677363328d074c2a72bed3e782606e489d3b8b90723bedc47",
+    "libgdk-pixbuf2.0-dev_2.31.1-2+deb8u7_amd64.deb": "4865703158abf88e57146bb9f2594ba137f04186804cca0817eccd5450351722",
+    "libgeos-3.4.2_3.4.2-6_amd64.deb": "0a2ac651a4d2032a8bf337cf465ef15464daea956fe967cdfec205b6241288a3",
+    "libgeos-c1_3.4.2-6_amd64.deb": "8a14eb69db0c2d4f0f6dd0915c7ccd7bd4df001fa855236c8b0ca57352f23095",
+    "libgirepository-1.0-1_1.42.0-2.2_amd64.deb": "b66a761b672e5aa89eca33c5d36b0efec569fa468b063243e2b61daa78d68ad6",
+    "libglib2.0-0_2.42.1-1+b1_amd64.deb": "a4b30c84c0c050f23a986fbc576daa04b246ab816ec0fcb0b471d19aa2689a97",
+    "libglib2.0-bin_2.42.1-1+b1_amd64.deb": "8ca70ec77924ba07bc6ab3e4f7833dea7abdb1a70bf0be655989e0245593e92e",
+    "libglib2.0-data_2.42.1-1_all.deb": "15c1e8de648a00a1599e16a7680359f973c9fd58a96d881016678baa8c42a8dd",
+    "libglib2.0-dev_2.42.1-1+b1_amd64.deb": "ad483c4da4da80c317084f86b74adc2934b4674e8e40c9e076a6c1f7c3a2f8fa",
+    "libgmp10_6.0.0+dfsg-6_amd64.deb": "155a31b0f716aa3dcd7ee68e9bd57e0b76a6b31f4e41fb2d953e986315437082",
+    "libgnutls-deb0-28_3.3.8-6+deb8u7_amd64.deb": "a5685d0dc8bcf06a9e858bb8c8d9e9edf4376729dcabb9557e13fdac365e8a3c",
+    "libgpg-error0_1.17-3_amd64.deb": "7b156391cb5aef83df692bf4f966313d5fbd96481945dc65b384471067d16124",
+    "libgraphite2-3_1.3.10-1~deb8u1_amd64.deb": "49e1434c15e17654714b7f158d75d8a8a2f0bef7c7d1f7eb9e6f1c55ec69c598",
+    "libgssapi-krb5-2_1.12.1+dfsg-19+deb8u4_amd64.deb": "47a50d69b9972fdb8f625e23583b51416bd18659e24276047302a22063135f01",
+    "libgtk-3-0_3.14.5-1+deb8u1_amd64.deb": "062c11c06d774d18c008b9efe0f479517f2bcebf9e990ae8508a04596fcdf054",
+    "libgtk-3-bin_3.14.5-1+deb8u1_amd64.deb": "f81e59d387487c4852c9816b3243b19e63bc29c2d683351cac08b86afbdebfe4",
+    "libgtk-3-common_3.14.5-1+deb8u1_all.deb": "4de6cc260354cecc903dc57c4ab948c020faa04cf5aac452e87412cfa1296863",
+    "libgtk-3-dev_3.14.5-1+deb8u1_amd64.deb": "54167ed47c7057221444ae23616c4494b156ba7a126f92e52381c256fa1a29bb",
+    "libharfbuzz-dev_0.9.35-2_amd64.deb": "175de037a0a89c088988c5ebf6b9939893c3aabbfda2e6cb2ddb14457285e3db",
+    "libharfbuzz-gobject0_0.9.35-2_amd64.deb": "16a37cd0b880d32aec61f10bfa04ef5b43a34028f2e1f86363cf0377d03907fa",
+    "libharfbuzz-icu0_0.9.35-2_amd64.deb": "21a311fc3b6a8b5ade3e1fd7ee265170146766206f52e209514c494d4ca96d14",
+    "libharfbuzz0b_0.9.35-2_amd64.deb": "24cb370d0dab9769ab1cce6a8362e5a785152b253319789ac6d2420f1ce42185",
+    "libhogweed2_2.7.1-5+deb8u2_amd64.deb": "9b95be6e2db3bbb912fcb7fa4bb306e2f6abb029d26c7ea63e942380a3535763",
+    "libice-dev_1.0.9-1+b1_amd64.deb": "fb72338b69d4e07d7594b12a37db24014525543fe66e0e973d402a60a30a5efa",
+    "libice6_1.0.9-1+b1_amd64.deb": "6b6aefe57b52ac77dc0891c96f6f00472fdd1e9d14128aa5a60e337c5602158d",
+    "libicu52_52.1-8+deb8u7_amd64.deb": "708d4499e2f6344a77d903c2c03a958f5edac32f9adf5ff3da7b572bf307e980",
+    "libjasper1_1.900.1-debian1-2.4+deb8u3_amd64.deb": "a0887eb2f617ac0031ba195fd00119c85f3c20eb9d9670b2dc2d93e75faf1de9",
+    "libjbig0_2.1-3.1_amd64.deb": "d0b55e2da6648d6b91ced51e8c8ccfbe024283ffbbc1484f704ff7b0c97f8c51",
+    "libjpeg62-turbo_1.3.1-12_amd64.deb": "ac397a0c8d16891dbc0348a9ee30506b8b4cafe138a25b3af9e3cd0b417fab3d",
+    "libjson-glib-1.0-0_1.0.2-1_amd64.deb": "795df8460d3ae8f6b05133d43ca60949d5f48ea266a7461df6c7670eb75d813c",
+    "libjson-glib-1.0-common_1.0.2-1_all.deb": "5ca554f121dbc7200f5c545fdf6a9aacb6eda6a2e521b5307915c9b24016ca12",
+    "libk5crypto3_1.12.1+dfsg-19+deb8u4_amd64.deb": "2c4cba5d1528310c1863c29e7d8a1f44c2ed8c98811953cafff1f0197b809abb",
+    "libkeyutils1_1.5.9-5+b1_amd64.deb": "ab6369dab6e1dc690e10dfd621bc424392d9ffa5261e2079f3306557a27d4fb3",
+    "libkrb5-3_1.12.1+dfsg-19+deb8u4_amd64.deb": "bfd66673f3874fb18a02a4073867bfec3e31c5d22af5ceb9b2d12a7fe41b2789",
+    "libkrb5support0_1.12.1+dfsg-19+deb8u4_amd64.deb": "b8fa115d2cf2135aaa700e9504ccfa70d37fc13075b1d03e0fe3e998cc60fdbf",
+    "liblcms2-2_2.6-3+deb8u2_amd64.deb": "c388856db0c3c52756f317cb2b48764afbca2781e91df96e6a286f6c7add98c6",
+    "liblzo2-2_2.08-1.2_amd64.deb": "30316e5c74b66016efb62efe1b83574692dfa84dc6b8d060e623b26320574250",
+    "libnettle4_2.7.1-5+deb8u2_amd64.deb": "6917d0fd576ec89004eef355a5700eeb51fc35678e660797621af2a8f483fcf0",
+    "libp11-kit0_0.20.7-1_amd64.deb": "50be06cb69c72cbedf6942c8b8929400ceb6e7a198c52b16698aace41e411d40",
+    "libpam-modules-bin_1.1.8-3.1+deb8u2+b1_amd64.deb": "6bf89d49b697566d04a799cd43adb5520403e75149dbd71a13d63964f2c7b121",
+    "libpam-modules_1.1.8-3.1+deb8u2+b1_amd64.deb": "c9aee820343411579bd139a86e4561152eb3461edd13770984c996a06e32c2c1",
+    "libpam0g_1.1.8-3.1+deb8u2+b1_amd64.deb": "a58b055542ff90214da028af9c61fa521591a1c76640b5b4884216b73117c9b1",
+    "libpango-1.0-0_1.36.8-3_amd64.deb": "54c29cbec70cc2dc45affb3cece358e6a8c57c0c4c4a1690f3adac472c8ee24c",
+    "libpango1.0-dev_1.36.8-3_amd64.deb": "b85efd67f96eabc1f0eb8499c7edd163e4499193018165518b7a28b7f25f79cd",
+    "libpangocairo-1.0-0_1.36.8-3_amd64.deb": "c088f8e9ce755eed168ff1e5be789252cadd4199070f2df703acb41742d90186",
+    "libpangoft2-1.0-0_1.36.8-3_amd64.deb": "30f34db7a73ac7e1b8f2945ac1b5d34e649beb2fa71b2232c0ccde0ca19e697d",
+    "libpangoxft-1.0-0_1.36.8-3_amd64.deb": "84eaefeaa33e6dca732e534a371a7a508614cac22369320bbfa6fd040352a8d4",
+    "libpcre3-dev_8.35-3.3+deb8u4_amd64.deb": "855664aec18478730873f28879c463c23817180f5d69b47df2c5e2bce297d8bf",
+    "libpcrecpp0_8.35-3.3+deb8u4_amd64.deb": "90bb808b764e359ded52cc44dd1ced85436af7f42b49895d3ea76dfc7828e4ae",
+    "libpixman-1-0_0.32.6-3_amd64.deb": "dfce4b6483c5704da051bc7da6aee76c025bf8a093212be122e956d7a8ea4c64",
+    "libpixman-1-dev_0.32.6-3_amd64.deb": "9fb6e86fcfe3d8de8b05b24242fb9fc0e3af7171feb241c45aac2333a0bde5c6",
+    "libpng12-0_1.2.50-2+deb8u3_amd64.deb": "fa86f58f9595392dc078abe3b446327089c47b5ed8632c19128a156a1ea68b96",
+    "libpng12-dev_1.2.50-2+deb8u3_amd64.deb": "f21802bcb4960acd520dc218fcaaa78ea83102ff4d382df340eafec0aa62b203",
+    "libproxy1_0.4.11-4+b2_amd64.deb": "b7b4916f37886b331027199fa6070193cd0102f1256bd0d84b1491596b68e298",
+    "libpthread-stubs0-dev_0.3-4_amd64.deb": "4e2f6d1c1fed2c94841ce2ad33e38b997ae73415e8ed5a0e1210b757ab84e849",
+    "librest-0.7-0_0.7.92-3_amd64.deb": "dae22142f1fd24ea38ea0fc1950937c1886db652d21d46a2a54d546ce73ca86d",
+    "librsvg2-2_2.40.5-1+deb8u2_amd64.deb": "fead83722cc48a6cd679e3b847b88d6cfaca0847bc7d80c4ef6f10568c24fe08",
+    "librsvg2-common_2.40.5-1+deb8u2_amd64.deb": "3446906dcef313936df7fa06c609d5ee03f3512a12bb19465ab1c5b6c8b11c68",
+    "libsemanage-common_2.3-1_all.deb": "6cee4cf858797141ecb5775f33a82cb7ffb5d2c047a0fb9f4ed08005b9c33671",
+    "libsemanage1_2.3-1+b1_amd64.deb": "1d8e7b5c75e6b60769241da5f33c6befffb1a8dc5826474b3191f8f1d1690634",
+    "libsepol1_2.3-2_amd64.deb": "809665fb316152e1c862873abe1f4358302ab8bdab9b034bbe178f0e68257f56",
+    "libsm-dev_1.2.2-1+b1_amd64.deb": "6dfc839e786e3870b7fdf9cd69545ef2fb4cc89f88ab38b84fd7439b989b0eee",
+    "libsm6_1.2.2-1+b1_amd64.deb": "4e2239321aaeffef7dc4a4b4196bb3b3d3b11a4b3b613818e18cc96ab9ee1508",
+    "libsoup-gnome2.4-1_2.48.0-1+deb8u2_amd64.deb": "a5c06b60ca67d780425e4051f25962c021ccc81ec74949461a13933d6709da10",
+    "libsoup2.4-1_2.48.0-1+deb8u2_amd64.deb": "9796bb2aea1c4c6187b54d733f334641336c5ed75e46dc4f08da2d4316e90fdd",
+    "libstdc++6_4.9.2-10+deb8u1_amd64.deb": "a8f4ef6773b90bb39a8a8a0a5e3e20ca8501de6896204f665eb114d5b79f164f",
+    "libsystemd0_215-17+deb8u7_amd64.deb": "ff84ae8db25dc8f4218c6a2161439a6f5f73f44d7115b8c930612657b865fb69",
+    "libtasn1-6_4.2-3+deb8u3_amd64.deb": "36e01f21f439ede1e6957110798375808303d2c6549236811844bf014add93d0",
+    "libthai-data_0.1.21-1_all.deb": "805c372a6f0da8e487933638cf74d969626175d2f77682691bd5c74b3bc02168",
+    "libthai0_0.1.21-1_amd64.deb": "992e35bf8c1685ba1cb439a99a78db72c7960075cb25cf3175d67f782cbb75c3",
+    "libtiff5_4.0.3-12.3+deb8u6_amd64.deb": "73f4e28cd270d59698feb45564fb73329eef645c645218420d600d7e13115b84",
+    "libudev1_215-17+deb8u7_amd64.deb": "35cbd0325c5300e86d0bb5c5bf3a538635b78b56e503dc2f22826b2d53343fcd",
+    "libustr-1.0-1_1.0.4-3+b2_amd64.deb": "e04f13c3b977bdcd80a2d3f9c45bf2ed336fb5398fbb9f86873f722d8bd1784a",
+    "libuuid1_2.25.2-6_amd64.deb": "ab7821a322a6c137eb7b36297eba11a5d2a3d3c27e480a238ff4538898570fb9",
+    "libwayland-client0_1.6.0-2_amd64.deb": "dfb1cf0048f35ec1da9752ee9966aaf8014d1ee160377d0e4631d526e328ab31",
+    "libwayland-cursor0_1.6.0-2_amd64.deb": "e003049613ad688ad33a472c902b086b30f13161dee305e085d5a47876d3ecd5",
+    "libwayland-dev_1.6.0-2_amd64.deb": "f7a6fe5ada07b1463c2df3f59d14b3e7371afaaf55731a893a6001d739bea31b",
+    "libwayland-server0_1.6.0-2_amd64.deb": "8954be62de87a6a0a63ca1438b8e6386cd2f2708af2125c1c57ec72421f53893",
+    "libx11-6_1.6.2-3+deb8u2_amd64.deb": "aac2335619b5a9ebabfd2be2d63d9f6791faf15993dc54abafde1fdf74297174",
+    "libx11-data_1.6.2-3+deb8u2_all.deb": "8b5c2679ca7ddee702ef58f2d31e7176bc7d08d648089a3b0ac48d51ec8f10e1",
+    "libx11-dev_1.6.2-3+deb8u2_amd64.deb": "8a3189ee53d6bf36558eaf262eb9bece3918df16906cf391eec28a96cbdee200",
+    "libxau-dev_1.0.8-1_amd64.deb": "256706493b32161b061c9fa452df1774d5004879cb73262ae2b52aa93b5dd91a",
+    "libxau6_1.0.8-1_amd64.deb": "b03b2d0d400c2002a2d38300bd6630306abb0ff325c3d4a4447ecceb58335228",
+    "libxcb-render0-dev_1.10-3+b1_amd64.deb": "ab98d4d5288bfedc75151ea69a2db20e24c9cfb7a88e3501e6bf4abc8f1eac57",
+    "libxcb-render0_1.10-3+b1_amd64.deb": "1277261ed3b901d70b01901836b2f6d89235dd6777636f3f26b5d2979f1c7e22",
+    "libxcb-shm0-dev_1.10-3+b1_amd64.deb": "2e2c84d6f2967a73d2c41ee63b754b74ffe382f52695fe9abe15f29bfbcdab0a",
+    "libxcb-shm0_1.10-3+b1_amd64.deb": "724749f2ea6a471ba353f6a93585bf98577c2103648297fac40c46b9a08671b0",
+    "libxcb1-dev_1.10-3+b1_amd64.deb": "b7897143190b96156330fbf4b0922911e79605a637169bdd795a3935ac89a8b2",
+    "libxcb1_1.10-3+b1_amd64.deb": "07bf131f4f0f8a9f1a023ab88cce3a1d12cc7222d3c7f08f00b60a3699af5188",
+    "libxcomposite-dev_0.4.4-1_amd64.deb": "13e10b5fe5684d51c34400f4bd3af4924c1e8df3b2c2ec97651c69af2cca7995",
+    "libxcomposite1_0.4.4-1_amd64.deb": "ff739711c5aa6df107fdfb6e13491e8317b2c45477d91a6b17da5660cd8ca8f4",
+    "libxcursor-dev_1.1.14-1+deb8u2_amd64.deb": "7bcddee3eeecdb4e36fbac248ccee9a7f003fda00a4f2f500525413fbcc7b592",
+    "libxcursor1_1.1.14-1+deb8u2_amd64.deb": "011d069b9bf6604c19c1d07dc7214b24a8fea6dfbb6748fb1fd90532c855c00b",
+    "libxdamage-dev_1.1.4-2+b1_amd64.deb": "8c2e84a5abf0659c25e63a8378c409fa933a84c3e5b03b8d26bfdc2fa422d108",
+    "libxdamage1_1.1.4-2+b1_amd64.deb": "c2b13deaa87dbad7d541e29755464f125409b9d4d038d6982bb9f8f35939b817",
+    "libxdmcp-dev_1.1.1-1+b1_amd64.deb": "953ad14c0ce8e57cd0aecf7b600494a15fec75ef348d316f31346c87058b6b5c",
+    "libxdmcp6_1.1.1-1+b1_amd64.deb": "6758bc820616254634fdd2354a2691e40d2973d6bf3a9c12417f02770f75081c",
+    "libxext-dev_1.3.3-1_amd64.deb": "35d62e8b6c72ea9ae67488f06360224a918f6d87ceb27575f49a9e712bf8b70a",
+    "libxext6_1.3.3-1_amd64.deb": "5105f77289a7e08faaf3bb4c16c6945cafca65b9bdb4792fef820045ab43e568",
+    "libxfixes-dev_5.0.1-2+deb8u1_amd64.deb": "4dc7467a9dbc531d95884217437e2e8e856c8f211fe3fcebb2297998f72901b3",
+    "libxfixes3_5.0.1-2+deb8u1_amd64.deb": "bc30bf139964c7505776374c7ba8a7f9bd7c6bd101823f3d6a1f3b0bf11e41ee",
+    "libxft-dev_2.3.2-1_amd64.deb": "c811f5f4e941224852f44b5b284c383f8b1d4c6bfd1ce15b19331eeb9b54aace",
+    "libxft2_2.3.2-1_amd64.deb": "38d6013c0b6305caf38932e6274108d81b2b2df0dd67f04987aa3f69c1e6677e",
+    "libxi-dev_1.7.4-1+deb8u1_amd64.deb": "77dd8c34c69d86dec841028c0fca646544cea079ee95643db3fdc15cbdf9d8bf",
+    "libxi6_1.7.4-1+deb8u1_amd64.deb": "a99de627a07f54bc40e5dc77e3ca7e9d9b5619e068f1bb303f86edd138d6d037",
+    "libxinerama-dev_1.1.3-1+b1_amd64.deb": "0e2504bbe3501aae376691e2519336533309c8a97715f8a2b060cdcd6abce15f",
+    "libxinerama1_1.1.3-1+b1_amd64.deb": "3668c1178ac649879338192759e79879e0f5797764b448dcac6aed4b24ef495b",
+    "libxkbcommon-dev_0.4.3-2_amd64.deb": "65e9044239f62b82d92582cb9d210ebe42e9c335c78b6c78977db996b7eacf77",
+    "libxkbcommon0_0.4.3-2_amd64.deb": "380200621efda1fb05daea2f858baad10c776a2ae0fd1fbce1844111f8cdff08",
+    "libxml2_2.9.1+dfsg1-5+deb8u7_amd64.deb": "34dcf3dc64e65935fa9e31ba9aa5d1795ed054f17203f01255a1875e55435f70",
+    "libxrandr-dev_1.4.2-1+deb8u1_amd64.deb": "d64ac2abe410fe6e25c6de2b90fd2a65dbfdf027c117a574714a0a60c019738f",
+    "libxrandr2_1.4.2-1+deb8u1_amd64.deb": "e59996ac0e993331799aa7bc768f7edd7b0baec0fafdbeebeef658834ba96b63",
+    "libxrender-dev_0.9.8-1+b1_amd64.deb": "d17bd9a32eaecdd75d465d38bfc6318aa00e92fa5289ed36a8853f94feb18cbe",
+    "libxrender1_0.9.8-1+b1_amd64.deb": "8980934c84c0ebbca4158023d91ced3ddbfa028a2be25959ff4566b37eceb8f4",
+    "libxtst-dev_1.2.2-1+deb8u1_amd64.deb": "185f048b97dc6c5eb2ce6cc433bdd617ce81ea886162907bb0905e03b04b7e9f",
+    "libxtst6_1.2.2-1+deb8u1_amd64.deb": "caf381b445c684c1d8b46e14750bba16999ab71067ec823060c70778d19d3300",
+    "lsb-base_4.1+Debian13+nmu1_all.deb": "1a200ffcc9d21838768f3acdc512e6ad6a8502bb70ecd3f597b660a56acaf739",
+    "passwd_4.2-3+deb8u4_amd64.deb": "fcbfdc2d0b102babbb7dc5d477a03a09f0b563a42a2b80508e7a18523138fead",
+    "pkg-config_0.28-1_amd64.deb": "0c2454f379d35c3acdeed1bb2b15e5fb8629fb347908a4fbe8815ec29e07f326",
+    "python3-cairo_1.10.0+dfsg-4+b1_amd64.deb": "89dd5d7a430e75fe31d95b92c84f97295164f419df166dfc9951d7bb89f76327",
+    "python3-gi-cairo_3.14.0-1_amd64.deb": "e67dee22e98f1c555fcff23cf2efbd2ef4a90b35200fe0edcc49e853401daf0f",
+    "python3-gi_3.14.0-1_amd64.deb": "67c6c67daf622fe0e0f38627873df6a8589d8716ce3ff41b4fde2e5f15235479",
+    "python3-shapely_1.4.3-1_amd64.deb": "c6bcd18fdd512b8d0a1516909e49a04a876cec60156c742ceab98405ec754389",
+    "python_2.7.9-1_amd64.deb": "93dc9d03df366d658832fb238a6c1e6c57e5e57dd648145c2f57a8f3e2b419ed",
+    "sensible-utils_0.0.9+deb8u1_all.deb": "0de3d1447f16851862e57951a6779c5adc9a97d0438092b2761c0d989c64ae9c",
+    "shared-mime-info_1.3-1_amd64.deb": "50c122e36f96e5cc808c6b7528ebd27f8086783e2c5b7c39ac7f6da6f62b09c1",
+    "ttf-bitstream-vera_1.10-8_all.deb": "328def7f581bf94b3b06d21e641f3e5df9a9b2e84e93b4206bc952fe8e80f38a",
+    "ucf_3.0030_all.deb": "1b93d9fc5930b9d8382705b71605e07fe11f4796db239b7ac2644bf4fbd7f6a2",
+    "x11-common_7.7+7_all.deb": "5ea7301f38ffdfd987655e55b7ce74aa556718f20fca79077e0cf69372022c95",
+    "x11proto-composite-dev_0.4.2-2_all.deb": "524fcfc77f61bcfda270ae6e2508e2eebdbf39e7d611d8ee13cd7ab38e2c0a44",
+    "x11proto-core-dev_7.0.26-1_all.deb": "9d60c962746bf2d1b1eb69e872a57eb21e13b341329ca592fd8eca527bab1df6",
+    "x11proto-damage-dev_1.2.1-2_all.deb": "a4fa4c2f2a24d0a1d49c66315c17d1600d1583ac20f7627bcec3aedc47865f2f",
+    "x11proto-fixes-dev_5.0-2_all.deb": "e08e0aa9b58ffccc7685c6715df77a9c00781575a6229b4497b06b32bd61336c",
+    "x11proto-input-dev_2.3.1-1_all.deb": "a61a10b34cb0ffac6a2603971be1afd4908ed2830b6a1c554e74ac3321bb1e35",
+    "x11proto-kb-dev_1.0.6-2_all.deb": "b7ff8eceb9f05eb470700807c73fdae88f5f9f8b8fbef869029882264dbebd81",
+    "x11proto-randr-dev_1.4.0-2_all.deb": "3d49d2e205da5d2ca4cdca8d5782e47da5c11ad762c046ffb6173beb5f0d837e",
+    "x11proto-record-dev_1.14.2-1_all.deb": "288f8b9f4b050ae21f6ab7c70503c66a3177be6611ae08045d128cba9dfa5ea9",
+    "x11proto-render-dev_0.11.1-2_all.deb": "606d63fab57421afe305e4866edb1948e4f9090409d6f63199838ac269d8cfba",
+    "x11proto-xext-dev_7.3.0-1_all.deb": "bb505470525281ad330093a9d9d23f4a36b00d0b8502dcbc05e44781375abdf0",
+    "x11proto-xinerama-dev_1.2.1-2_all.deb": "b043b371e81e8e276eefca53dc114947bf984a3a004ef007452c3f74560ce140",
+    "xkb-data_2.12-1_all.deb": "57c41945a76d9620af0df4dcb0aa7e62e1be9fa69b433fd0a577e116abcb28d3",
+    "xorg-sgml-doctools_1.11-1_all.deb": "359dc76bf7b19fbbdb0b9e3ca3077e415b5b9ca8ff85162ccc889f9974493600",
+    "xtrans-dev_1.3.4-1_all.deb": "c4e0b9534370762410efdaaa7375c97c95b77c60ec1502448dd549625d192786",
+    "zlib1g-dev_1.2.8.dfsg-2+b1_amd64.deb": "71678d2ff2774a726f413cd46a923f960cdcfb56f063d20c1544a2d8b6d12d7f",
+}
diff --git a/debian/python_shapely_init.patch b/debian/python_shapely_init.patch
new file mode 100644
index 0000000..0304760
--- /dev/null
+++ b/debian/python_shapely_init.patch
@@ -0,0 +1,8 @@
+--- a/__init__.py	2018-10-17 21:55:40.000000000 -0700
++++ b/__init__.py	2018-10-17 22:54:48.798723540 -0700
+@@ -1 +1,5 @@
+ __version__ = "1.4.3"
++
++import os
++_base = os.path.dirname(os.path.dirname(__file__))
++os.environ['LIBRARY_PATH'] = os.path.join(_base, 'rpathed', 'usr', 'lib')
diff --git a/frc971/analysis/logentry.py b/frc971/analysis/logentry.py
index 3069af0..0d703e3 100644
--- a/frc971/analysis/logentry.py
+++ b/frc971/analysis/logentry.py
@@ -268,7 +268,7 @@
     print(line)
     print(line.ParseStruct())
 
-  line = ParseLine('claw(2263)(19404): DEBUG   at 0000000820.00000s: ../../aos/common/controls/control_loop-tmpl.h: 104: position: .frc971.control_loops.ClawGroup.Position{top:.frc971.control_loops.HalfClawPosition{position:1.672153, front:.frc971.HallEffectStruct{current:f, posedge_count:0, negedge_count:52}, calibration:.frc971.HallEffectStruct{current:f, posedge_count:6, negedge_count:13}, back:.frc971.HallEffectStruct{current:f, posedge_count:0, negedge_count:62}, posedge_value:0.642681, negedge_value:0.922207}, bottom:.frc971.control_loops.HalfClawPosition{position:1.353539, front:.frc971.HallEffectStruct{current:f, posedge_count:2, negedge_count:150}, calibration:.frc971.HallEffectStruct{current:f, posedge_count:8, negedge_count:18}, back:.frc971.HallEffectStruct{current:f, posedge_count:0, negedge_count:6}, posedge_value:0.434514, negedge_value:0.759491}}')
+  line = ParseLine('claw(2263)(19404): DEBUG   at 0000000820.00000s: ../../aos/controls/control_loop-tmpl.h: 104: position: .frc971.control_loops.ClawGroup.Position{top:.frc971.control_loops.HalfClawPosition{position:1.672153, front:.frc971.HallEffectStruct{current:f, posedge_count:0, negedge_count:52}, calibration:.frc971.HallEffectStruct{current:f, posedge_count:6, negedge_count:13}, back:.frc971.HallEffectStruct{current:f, posedge_count:0, negedge_count:62}, posedge_value:0.642681, negedge_value:0.922207}, bottom:.frc971.control_loops.HalfClawPosition{position:1.353539, front:.frc971.HallEffectStruct{current:f, posedge_count:2, negedge_count:150}, calibration:.frc971.HallEffectStruct{current:f, posedge_count:8, negedge_count:18}, back:.frc971.HallEffectStruct{current:f, posedge_count:0, negedge_count:6}, posedge_value:0.434514, negedge_value:0.759491}}')
   print(line.ParseStruct())
 
   line = ParseLine('joystick_proxy(2255)(39560): DEBUG   at 0000000820.00730s: ../../aos/prime/input/joystick_input.cc: 61: sending: .aos.RobotState{joysticks:[.aos.Joystick{buttons:0, axis:[0.000000, 1.000000, 1.000000, 0.000000]}, .aos.Joystick{buttons:0, axis:[-0.401575, 1.000000, -1.007874, 0.000000]}, .aos.Joystick{buttons:0, axis:[0.007874, 0.000000, 1.000000, -1.007874]}, .aos.Joystick{buttons:0, axis:[0.000000, 0.000000, 0.000000, 0.000000]}], test_mode:f, fms_attached:f, enabled:T, autonomous:f, team_id:971, fake:f}')
diff --git a/frc971/autonomous/BUILD b/frc971/autonomous/BUILD
index 5fe1455..003ceb6 100644
--- a/frc971/autonomous/BUILD
+++ b/frc971/autonomous/BUILD
@@ -8,7 +8,7 @@
     'auto.q',
   ],
   deps = [
-    '//aos/common/actions:action_queue',
+    '//aos/actions:action_queue',
   ],
 )
 
@@ -22,9 +22,9 @@
   ],
   deps = [
     ':auto_queue',
-    '//aos/common/actions:action_lib',
-    '//aos/common/util:phased_loop',
-    '//aos/common/logging',
+    '//aos/actions:action_lib',
+    '//aos/util:phased_loop',
+    '//aos/logging',
     '//frc971/control_loops/drivetrain:drivetrain_config',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
   ],
diff --git a/frc971/autonomous/auto.q b/frc971/autonomous/auto.q
index 1f639b1..b72688e 100644
--- a/frc971/autonomous/auto.q
+++ b/frc971/autonomous/auto.q
@@ -1,6 +1,6 @@
 package frc971.autonomous;
 
-import "aos/common/actions/actions.q";
+import "aos/actions/actions.q";
 
 message AutoControl {
   // True if auto mode should be running, false otherwise.
diff --git a/frc971/autonomous/base_autonomous_actor.cc b/frc971/autonomous/base_autonomous_actor.cc
index 3363125..df558ab 100644
--- a/frc971/autonomous/base_autonomous_actor.cc
+++ b/frc971/autonomous/base_autonomous_actor.cc
@@ -5,8 +5,8 @@
 #include <chrono>
 #include <cmath>
 
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/logging/logging.h"
+#include "aos/util/phased_loop.h"
+#include "aos/logging/logging.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 
diff --git a/frc971/autonomous/base_autonomous_actor.h b/frc971/autonomous/base_autonomous_actor.h
index c8f6398..dd53a7d 100644
--- a/frc971/autonomous/base_autonomous_actor.h
+++ b/frc971/autonomous/base_autonomous_actor.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/actions/actions.h"
-#include "aos/common/actions/actor.h"
+#include "aos/actions/actions.h"
+#include "aos/actions/actor.h"
 #include "frc971/autonomous/auto.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain_config.h"
diff --git a/frc971/codelab/BUILD b/frc971/codelab/BUILD
index 2823200..252e01d 100644
--- a/frc971/codelab/BUILD
+++ b/frc971/codelab/BUILD
@@ -9,8 +9,8 @@
     ':basic_queue',
     ':basic',
     '//aos/testing:googletest',
-    '//aos/common:queues',
-    '//aos/common/controls:control_loop_test',
+    '//aos:queues',
+    '//aos/controls:control_loop_test',
     '//frc971/control_loops:state_feedback_loop',
     '//frc971/control_loops:team_number_test_environment',
   ],
@@ -23,7 +23,7 @@
   hdrs = ['basic.h'],
   deps = [
     ':basic_queue',
-    '//aos/common/controls:control_loop',
+    '//aos/controls:control_loop',
   ],
 )
 
@@ -33,7 +33,7 @@
     'basic.q',
   ],
   deps = [
-    '//aos/common/controls:control_loop_queues',
+    '//aos/controls:control_loop_queues',
     '//frc971/control_loops:queues',
   ],
 )
diff --git a/frc971/codelab/basic.h b/frc971/codelab/basic.h
index b67fdbd..0332168 100644
--- a/frc971/codelab/basic.h
+++ b/frc971/codelab/basic.h
@@ -1,8 +1,8 @@
 #ifndef FRC971_CODELAB_BASIC_H_
 #define FRC971_CODELAB_BASIC_H_
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/time.h"
+#include "aos/controls/control_loop.h"
+#include "aos/time/time.h"
 
 #include "frc971/codelab/basic.q.h"
 
diff --git a/frc971/codelab/basic.q b/frc971/codelab/basic.q
index 8183271..58fd69e 100644
--- a/frc971/codelab/basic.q
+++ b/frc971/codelab/basic.q
@@ -1,6 +1,6 @@
 package frc971.codelab;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/control_loops.q";
 
 // The theme of this basic test is a simple intake system.
diff --git a/frc971/codelab/basic_test.cc b/frc971/codelab/basic_test.cc
index 0acf9e7..0761cb2 100644
--- a/frc971/codelab/basic_test.cc
+++ b/frc971/codelab/basic_test.cc
@@ -5,8 +5,8 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/controls/control_loop_test.h"
-#include "aos/common/queue.h"
+#include "aos/controls/control_loop_test.h"
+#include "aos/queue.h"
 #include "frc971/codelab/basic.q.h"
 #include "frc971/control_loops/team_number_test_environment.h"
 #include "gtest/gtest.h"
diff --git a/frc971/control_loops/BUILD b/frc971/control_loops/BUILD
index 12d3a4b..a25a2e8 100644
--- a/frc971/control_loops/BUILD
+++ b/frc971/control_loops/BUILD
@@ -13,7 +13,7 @@
         "team_number_test_environment.h",
     ],
     deps = [
-        "//aos/common/network:team_number",
+        "//aos/network:team_number",
         "//aos/testing:googletest",
     ],
 )
@@ -57,7 +57,7 @@
     deps = [
         ":position_sensor_sim",
         ":queues",
-        "//aos/common/logging",
+        "//aos/logging",
         "//aos/testing:googletest",
     ],
 )
@@ -104,7 +104,7 @@
     ],
     restricted_to = mcu_cpus,
     deps = [
-        "//aos/common/controls:polytope_uc",
+        "//aos/controls:polytope_uc",
         "//third_party/eigen",
     ],
 )
@@ -121,7 +121,7 @@
         "-lm",
     ],
     deps = [
-        "//aos/common/controls:polytope",
+        "//aos/controls:polytope",
         "//third_party/eigen",
     ],
 )
@@ -135,7 +135,7 @@
     ],
     restricted_to = mcu_cpus,
     deps = [
-        "//aos/common:macros",
+        "//aos:macros",
         "//third_party/eigen",
     ],
 )
@@ -149,8 +149,8 @@
         "//tools:armhf-debian",
     ],
     deps = [
-        "//aos/common:macros",
-        "//aos/common/logging",
+        "//aos:macros",
+        "//aos/logging",
         "//third_party/eigen",
     ],
 )
@@ -162,9 +162,9 @@
     ],
     deps = [
         ":state_feedback_loop",
-        "//aos/common:macros",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging",
+        "//aos:macros",
+        "//aos/controls:control_loop",
+        "//aos/logging",
         "//third_party/eigen",
     ],
 )
@@ -224,8 +224,8 @@
         ":profiled_subsystem_queue",
         ":simple_capped_state_feedback_loop",
         ":state_feedback_loop",
-        "//aos/common/controls:control_loop",
-        "//aos/common/util:trapezoid_profile",
+        "//aos/controls:control_loop",
+        "//aos/util:trapezoid_profile",
         "//frc971/zeroing",
     ],
 )
diff --git a/frc971/control_loops/coerce_goal.cc b/frc971/control_loops/coerce_goal.cc
index d98df09..311d882 100644
--- a/frc971/control_loops/coerce_goal.cc
+++ b/frc971/control_loops/coerce_goal.cc
@@ -2,7 +2,7 @@
 
 #include "Eigen/Dense"
 
-#include "aos/common/controls/polytope.h"
+#include "aos/controls/polytope.h"
 
 namespace frc971 {
 namespace control_loops {
diff --git a/frc971/control_loops/coerce_goal.h b/frc971/control_loops/coerce_goal.h
index b1d5c3c..801135a 100644
--- a/frc971/control_loops/coerce_goal.h
+++ b/frc971/control_loops/coerce_goal.h
@@ -3,7 +3,7 @@
 
 #include "Eigen/Dense"
 
-#include "aos/common/controls/polytope.h"
+#include "aos/controls/polytope.h"
 
 namespace frc971 {
 namespace control_loops {
diff --git a/frc971/control_loops/drivetrain/BUILD b/frc971/control_loops/drivetrain/BUILD
index 64d1d9d..16c6340 100644
--- a/frc971/control_loops/drivetrain/BUILD
+++ b/frc971/control_loops/drivetrain/BUILD
@@ -10,7 +10,7 @@
     ],
     deps = [
         ":drivetrain_queue",
-        "//aos/common/controls:replay_control_loop",
+        "//aos/controls:replay_control_loop",
         "//aos/linux_code:init",
         "//frc971/queues:gyro",
     ],
@@ -25,7 +25,7 @@
         "//tools:armhf-debian",
     ],
     deps = [
-        "//aos/common/controls:control_loop_queues",
+        "//aos/controls:control_loop_queues",
         "//frc971/control_loops:queues",
     ],
 )
@@ -61,14 +61,14 @@
         ":drivetrain_config",
         ":drivetrain_queue",
         ":gear",
-        "//aos/common:math",
-        "//aos/common/controls:control_loop",
-        "//aos/common/controls:polytope",
-        "//aos/common/logging:matrix_logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
-        "//aos/common/util:trapezoid_profile",
+        "//aos:math",
+        "//aos/controls:control_loop",
+        "//aos/controls:polytope",
+        "//aos/logging:matrix_logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
+        "//aos/util:trapezoid_profile",
         "//frc971:shifter_hall_effect",
         "//frc971/control_loops:coerce_goal",
         "//frc971/control_loops:state_feedback_loop",
@@ -87,12 +87,12 @@
         ":drivetrain_config",
         ":drivetrain_queue",
         ":gear",
-        "//aos/common:math",
-        "//aos/common/controls:polytope",
-        "//aos/common/logging:matrix_logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
+        "//aos:math",
+        "//aos/controls:polytope",
+        "//aos/logging:matrix_logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
         "//frc971/control_loops:coerce_goal",
         "//frc971/control_loops:state_feedback_loop",
     ],
@@ -124,8 +124,8 @@
     deps = [
         ":drivetrain_config_uc",
         ":gear",
-        "//aos/common:math",
-        "//aos/common/controls:polytope_uc",
+        "//aos:math",
+        "//aos/controls:polytope_uc",
         "//frc971/control_loops:coerce_goal_uc",
         "//frc971/control_loops:state_feedback_loop_uc",
     ],
@@ -171,10 +171,10 @@
         ":gear",
         ":polydrivetrain",
         ":ssdrivetrain",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging:matrix_logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/util:log_interval",
+        "//aos/controls:control_loop",
+        "//aos/logging:matrix_logging",
+        "//aos/logging:queue_logging",
+        "//aos/util:log_interval",
         "//frc971/queues:gyro",
         "//frc971/wpilib:imu_queue",
     ],
@@ -189,8 +189,8 @@
         ":drivetrain_config",
         ":drivetrain_lib",
         ":drivetrain_queue",
-        "//aos/common:queues",
-        "//aos/common/controls:control_loop_test",
+        "//aos:queues",
+        "//aos/controls:control_loop_test",
         "//aos/testing:googletest",
         "//frc971/control_loops:state_feedback_loop",
         "//frc971/queues:gyro",
diff --git a/frc971/control_loops/drivetrain/drivetrain.cc b/frc971/control_loops/drivetrain/drivetrain.cc
index 14c1a42..a4401ea 100644
--- a/frc971/control_loops/drivetrain/drivetrain.cc
+++ b/frc971/control_loops/drivetrain/drivetrain.cc
@@ -6,9 +6,9 @@
 #include <memory>
 #include "Eigen/Dense"
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/logging/matrix_logging.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/logging/matrix_logging.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "frc971/control_loops/drivetrain/polydrivetrain.h"
diff --git a/frc971/control_loops/drivetrain/drivetrain.h b/frc971/control_loops/drivetrain/drivetrain.h
index 83e6c52..3f6c32f 100644
--- a/frc971/control_loops/drivetrain/drivetrain.h
+++ b/frc971/control_loops/drivetrain/drivetrain.h
@@ -3,9 +3,9 @@
 
 #include "Eigen/Dense"
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/controls/polytope.h"
-#include "aos/common/util/log_interval.h"
+#include "aos/controls/control_loop.h"
+#include "aos/controls/polytope.h"
+#include "aos/util/log_interval.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain_config.h"
 #include "frc971/control_loops/drivetrain/gear.h"
diff --git a/frc971/control_loops/drivetrain/drivetrain.q b/frc971/control_loops/drivetrain/drivetrain.q
index a1c60c0..ed659c3 100644
--- a/frc971/control_loops/drivetrain/drivetrain.q
+++ b/frc971/control_loops/drivetrain/drivetrain.q
@@ -1,6 +1,6 @@
 package frc971.control_loops;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/control_loops.q";
 
 // For logging information about what the code is doing with the shifters.
diff --git a/frc971/control_loops/drivetrain/drivetrain_lib_test.cc b/frc971/control_loops/drivetrain/drivetrain_lib_test.cc
index 06b4f21..1c11ae2 100644
--- a/frc971/control_loops/drivetrain/drivetrain_lib_test.cc
+++ b/frc971/control_loops/drivetrain/drivetrain_lib_test.cc
@@ -3,10 +3,10 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/controls/control_loop_test.h"
-#include "aos/common/controls/polytope.h"
-#include "aos/common/network/team_number.h"
-#include "aos/common/time.h"
+#include "aos/controls/control_loop_test.h"
+#include "aos/controls/polytope.h"
+#include "aos/network/team_number.h"
+#include "aos/time/time.h"
 #include "gtest/gtest.h"
 
 #include "frc971/control_loops/coerce_goal.h"
diff --git a/frc971/control_loops/drivetrain/drivetrain_uc.q.h b/frc971/control_loops/drivetrain/drivetrain_uc.q.h
index e93af26..7fcdea1 100644
--- a/frc971/control_loops/drivetrain/drivetrain_uc.q.h
+++ b/frc971/control_loops/drivetrain/drivetrain_uc.q.h
@@ -1,7 +1,7 @@
 #ifndef FRC971_CONTROL_LOOPS_DRIVETRAIN_DRIVETRAIN_Q_H_
 #define FRC971_CONTROL_LOOPS_DRIVETRAIN_DRIVETRAIN_Q_H_
 #include <array>
-#include "aos/common/macros.h"
+#include "aos/macros.h"
 
 namespace frc971 {
 namespace control_loops {
diff --git a/frc971/control_loops/drivetrain/polydrivetrain.cc b/frc971/control_loops/drivetrain/polydrivetrain.cc
index 266acd5..c213b06 100644
--- a/frc971/control_loops/drivetrain/polydrivetrain.cc
+++ b/frc971/control_loops/drivetrain/polydrivetrain.cc
@@ -1,7 +1,7 @@
 #include "frc971/control_loops/drivetrain/polydrivetrain.h"
 
-#include "aos/common/commonmath.h"
-#include "aos/common/controls/polytope.h"
+#include "aos/commonmath.h"
+#include "aos/controls/polytope.h"
 #include "frc971/control_loops/coerce_goal.h"
 #ifdef __linux__
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
diff --git a/frc971/control_loops/drivetrain/polydrivetrain.h b/frc971/control_loops/drivetrain/polydrivetrain.h
index b93c1de..c09c527 100644
--- a/frc971/control_loops/drivetrain/polydrivetrain.h
+++ b/frc971/control_loops/drivetrain/polydrivetrain.h
@@ -1,17 +1,17 @@
 #ifndef FRC971_CONTROL_LOOPS_DRIVETRAIN_POLYDRIVETRAIN_H_
 #define FRC971_CONTROL_LOOPS_DRIVETRAIN_POLYDRIVETRAIN_H_
 
-#include "aos/common/controls/polytope.h"
+#include "aos/controls/polytope.h"
 
-#include "aos/common/commonmath.h"
+#include "aos/commonmath.h"
 #include "frc971/control_loops/coerce_goal.h"
 #include "frc971/control_loops/drivetrain/gear.h"
 #ifdef __linux__
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/matrix_logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/messages/robot_state.q.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/matrix_logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/robot_state/robot_state.q.h"
 #else
 #include "frc971/control_loops/drivetrain/drivetrain_uc.q.h"
 #endif  // __linux__
diff --git a/frc971/control_loops/drivetrain/replay_drivetrain.cc b/frc971/control_loops/drivetrain/replay_drivetrain.cc
index c535607..55e18ad 100644
--- a/frc971/control_loops/drivetrain/replay_drivetrain.cc
+++ b/frc971/control_loops/drivetrain/replay_drivetrain.cc
@@ -1,4 +1,4 @@
-#include "aos/common/controls/replay_control_loop.h"
+#include "aos/controls/replay_control_loop.h"
 #include "aos/linux_code/init.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
diff --git a/frc971/control_loops/drivetrain/ssdrivetrain.cc b/frc971/control_loops/drivetrain/ssdrivetrain.cc
index ad86b1f..925256b 100644
--- a/frc971/control_loops/drivetrain/ssdrivetrain.cc
+++ b/frc971/control_loops/drivetrain/ssdrivetrain.cc
@@ -1,8 +1,8 @@
 #include "frc971/control_loops/drivetrain/ssdrivetrain.h"
 
-#include "aos/common/commonmath.h"
-#include "aos/common/controls/polytope.h"
-#include "aos/common/logging/matrix_logging.h"
+#include "aos/commonmath.h"
+#include "aos/controls/polytope.h"
+#include "aos/logging/matrix_logging.h"
 
 #include "frc971/control_loops/coerce_goal.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
diff --git a/frc971/control_loops/drivetrain/ssdrivetrain.h b/frc971/control_loops/drivetrain/ssdrivetrain.h
index 5e261e9..ee8d145 100644
--- a/frc971/control_loops/drivetrain/ssdrivetrain.h
+++ b/frc971/control_loops/drivetrain/ssdrivetrain.h
@@ -1,11 +1,11 @@
 #ifndef FRC971_CONTROL_LOOPS_DRIVETRAIN_SSDRIVETRAIN_H_
 #define FRC971_CONTROL_LOOPS_DRIVETRAIN_SSDRIVETRAIN_H_
 
-#include "aos/common/commonmath.h"
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/controls/polytope.h"
-#include "aos/common/logging/matrix_logging.h"
-#include "aos/common/util/trapezoid_profile.h"
+#include "aos/commonmath.h"
+#include "aos/controls/control_loop.h"
+#include "aos/controls/polytope.h"
+#include "aos/logging/matrix_logging.h"
+#include "aos/util/trapezoid_profile.h"
 
 #include "frc971/control_loops/state_feedback_loop.h"
 #include "frc971/control_loops/coerce_goal.h"
diff --git a/frc971/control_loops/hybrid_state_feedback_loop.h b/frc971/control_loops/hybrid_state_feedback_loop.h
index 971f0b8..0fb803f 100644
--- a/frc971/control_loops/hybrid_state_feedback_loop.h
+++ b/frc971/control_loops/hybrid_state_feedback_loop.h
@@ -12,9 +12,9 @@
 #include "Eigen/Dense"
 #include "unsupported/Eigen/MatrixFunctions"
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/macros.h"
+#include "aos/controls/control_loop.h"
+#include "aos/logging/logging.h"
+#include "aos/macros.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 
 template <int number_of_states, int number_of_inputs, int number_of_outputs,
diff --git a/frc971/control_loops/position_sensor_sim_test.cc b/frc971/control_loops/position_sensor_sim_test.cc
index 0f09f7f..e68feee 100644
--- a/frc971/control_loops/position_sensor_sim_test.cc
+++ b/frc971/control_loops/position_sensor_sim_test.cc
@@ -7,7 +7,7 @@
 #include "gtest/gtest.h"
 #include "frc971/control_loops/control_loops.q.h"
 #include "frc971/control_loops/position_sensor_sim.h"
-#include "aos/common/die.h"
+#include "aos/die.h"
 
 namespace frc971 {
 namespace control_loops {
diff --git a/frc971/control_loops/profiled_subsystem.h b/frc971/control_loops/profiled_subsystem.h
index fe64b75..d98b5c9 100644
--- a/frc971/control_loops/profiled_subsystem.h
+++ b/frc971/control_loops/profiled_subsystem.h
@@ -8,8 +8,8 @@
 
 #include "Eigen/Dense"
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/util/trapezoid_profile.h"
+#include "aos/controls/control_loop.h"
+#include "aos/util/trapezoid_profile.h"
 #include "frc971/control_loops/control_loops.q.h"
 #include "frc971/control_loops/profiled_subsystem.q.h"
 #include "frc971/control_loops/simple_capped_state_feedback_loop.h"
diff --git a/frc971/control_loops/state_feedback_loop.h b/frc971/control_loops/state_feedback_loop.h
index fe224cc..dd581bf 100644
--- a/frc971/control_loops/state_feedback_loop.h
+++ b/frc971/control_loops/state_feedback_loop.h
@@ -13,9 +13,9 @@
 #include "unsupported/Eigen/MatrixFunctions"
 
 #if defined(__linux__)
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #endif
-#include "aos/common/macros.h"
+#include "aos/macros.h"
 
 template <int number_of_states, int number_of_inputs, int number_of_outputs,
           typename PlantType, typename ObserverType, typename Scalar>
diff --git a/frc971/control_loops/team_number_test_environment.cc b/frc971/control_loops/team_number_test_environment.cc
index 624a119..a8f4ca7 100644
--- a/frc971/control_loops/team_number_test_environment.cc
+++ b/frc971/control_loops/team_number_test_environment.cc
@@ -1,6 +1,6 @@
 #include "frc971/control_loops/team_number_test_environment.h"
 
-#include "aos/common/network/team_number.h"
+#include "aos/network/team_number.h"
 
 namespace frc971 {
 namespace control_loops {
diff --git a/frc971/control_loops/voltage_cap/voltage_cap_test.cc b/frc971/control_loops/voltage_cap/voltage_cap_test.cc
index 23e2f34..9ef4036 100644
--- a/frc971/control_loops/voltage_cap/voltage_cap_test.cc
+++ b/frc971/control_loops/voltage_cap/voltage_cap_test.cc
@@ -4,7 +4,7 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/queue.h"
+#include "aos/queue.h"
 #include "aos/testing/test_shm.h"
 
 namespace frc971 {
diff --git a/frc971/control_loops/zeroed_joint.h b/frc971/control_loops/zeroed_joint.h
index fcfd29f..75d0b56 100644
--- a/frc971/control_loops/zeroed_joint.h
+++ b/frc971/control_loops/zeroed_joint.h
@@ -3,7 +3,7 @@
 
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
+#include "aos/controls/control_loop.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 
 namespace frc971 {
diff --git a/frc971/wpilib/ADIS16448.cc b/frc971/wpilib/ADIS16448.cc
index 043d15f..9633626 100644
--- a/frc971/wpilib/ADIS16448.cc
+++ b/frc971/wpilib/ADIS16448.cc
@@ -7,9 +7,9 @@
 #include <math.h>
 #include <chrono>
 
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/messages/robot_state.q.h"
-#include "aos/common/time.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/robot_state/robot_state.q.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
 #include "frc971/wpilib/imu.q.h"
 #include "frc971/zeroing/averager.h"
diff --git a/frc971/wpilib/ADIS16448.h b/frc971/wpilib/ADIS16448.h
index 52090a1..0d5c93a 100644
--- a/frc971/wpilib/ADIS16448.h
+++ b/frc971/wpilib/ADIS16448.h
@@ -11,7 +11,7 @@
 #include "DigitalOutput.h"
 #undef ERROR
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "frc971/wpilib/spi_rx_clearer.h"
 
 namespace frc971 {
diff --git a/frc971/wpilib/BUILD b/frc971/wpilib/BUILD
index ae9d10a..61d19f3 100644
--- a/frc971/wpilib/BUILD
+++ b/frc971/wpilib/BUILD
@@ -21,8 +21,8 @@
     deps = [
         ":dma",
         ":dma_edge_counting",
-        "//aos/common:mutex",
-        "//aos/common/logging",
+        "//aos/mutex:mutex",
+        "//aos/logging",
         "//aos/linux_code:init",
         "//third_party:wpilib",
     ],
@@ -39,7 +39,7 @@
     restricted_to = ["//tools:roborio"],
     deps = [
         ":dma",
-        "//aos/common/logging",
+        "//aos/logging",
         "//third_party:wpilib",
     ],
 )
@@ -54,9 +54,9 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        "//aos/common:stl_mutex",
-        "//aos/common:time",
-        "//aos/common/logging",
+        "//aos/stl_mutex:stl_mutex",
+        "//aos/time:time",
+        "//aos/logging",
         "//aos/linux_code:init",
         "//third_party:wpilib",
     ],
@@ -74,7 +74,7 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        "//aos/common/logging",
+        "//aos/logging",
         "//third_party:wpilib",
     ],
 )
@@ -89,8 +89,8 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        "//aos/common:time",
-        "//aos/common/logging",
+        "//aos/time:time",
+        "//aos/logging",
         "//third_party:wpilib",
     ],
 )
@@ -106,11 +106,11 @@
     restricted_to = ["//tools:roborio"],
     deps = [
         ":gyro_interface",
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:phased_loop",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:phased_loop",
         "//aos/linux_code:init",
         "//frc971/queues:gyro",
         "//frc971/zeroing:averager",
@@ -127,8 +127,8 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        "//aos/common:mutex",
-        "//aos/common:time",
+        "//aos/mutex:mutex",
+        "//aos/time:time",
         "//frc971/queues:gyro",
         "//third_party:wpilib",
     ],
@@ -143,10 +143,10 @@
         "loop_output_handler.h",
     ],
     deps = [
-        "//aos/common:scoped_fd",
-        "//aos/common:time",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
+        "//aos/scoped:scoped_fd",
+        "//aos/time:time",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
         "//aos/linux_code:init",
     ],
 )
@@ -161,9 +161,9 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/network:team_number",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/network:team_number",
         "//aos/linux_code:init",
         "//third_party:wpilib",
     ],
@@ -179,8 +179,8 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
         "//third_party:wpilib",
     ],
 )
@@ -203,8 +203,8 @@
     restricted_to = ["//tools:roborio"],
     deps = [
         ":pdp_values",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/util:phased_loop",
+        "//aos/logging:queue_logging",
+        "//aos/util:phased_loop",
         "//aos/linux_code:init",
         "//third_party:wpilib",
     ],
@@ -240,10 +240,10 @@
     deps = [
         ":imu_queue",
         ":spi_rx_clearer",
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
         "//aos/linux_code:init",
         "//frc971/zeroing:averager",
         "//third_party:wpilib",
@@ -273,6 +273,6 @@
         "spi_rx_clearer.h",
     ],
     deps = [
-        "//aos/common/logging",
+        "//aos/logging",
     ],
 )
diff --git a/frc971/wpilib/LPD8806.h b/frc971/wpilib/LPD8806.h
index 84c4667..91915bf 100644
--- a/frc971/wpilib/LPD8806.h
+++ b/frc971/wpilib/LPD8806.h
@@ -4,7 +4,7 @@
 #include <memory>
 #include <atomic>
 
-#include "aos/common/mutex.h"
+#include "aos/mutex/mutex.h"
 
 #include "SPI.h"
 #undef ERROR
diff --git a/frc971/wpilib/buffered_pcm.cc b/frc971/wpilib/buffered_pcm.cc
index bd52079..9625073 100644
--- a/frc971/wpilib/buffered_pcm.cc
+++ b/frc971/wpilib/buffered_pcm.cc
@@ -5,7 +5,7 @@
 #include <HAL/HAL.h>
 #include <HAL/Ports.h>
 #include <HAL/Solenoid.h>
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace frc971 {
 namespace wpilib {
diff --git a/frc971/wpilib/dma_edge_counting.cc b/frc971/wpilib/dma_edge_counting.cc
index 8ea3071..9fffebe 100644
--- a/frc971/wpilib/dma_edge_counting.cc
+++ b/frc971/wpilib/dma_edge_counting.cc
@@ -1,6 +1,6 @@
 #include "frc971/wpilib/dma_edge_counting.h"
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace frc971 {
 namespace wpilib {
diff --git a/frc971/wpilib/dma_edge_counting.h b/frc971/wpilib/dma_edge_counting.h
index c8a00ea..779e78a 100644
--- a/frc971/wpilib/dma_edge_counting.h
+++ b/frc971/wpilib/dma_edge_counting.h
@@ -4,7 +4,7 @@
 #include <memory>
 #include <vector>
 
-#include "aos/common/macros.h"
+#include "aos/macros.h"
 
 #include "frc971/wpilib/dma.h"
 
diff --git a/frc971/wpilib/encoder_and_potentiometer.cc b/frc971/wpilib/encoder_and_potentiometer.cc
index 1787c3f..cee54e5 100644
--- a/frc971/wpilib/encoder_and_potentiometer.cc
+++ b/frc971/wpilib/encoder_and_potentiometer.cc
@@ -1,7 +1,7 @@
 #include "frc971/wpilib/encoder_and_potentiometer.h"
 
 #include "aos/linux_code/init.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace frc971 {
 namespace wpilib {
diff --git a/frc971/wpilib/encoder_and_potentiometer.h b/frc971/wpilib/encoder_and_potentiometer.h
index 3cce77d..ec45657 100644
--- a/frc971/wpilib/encoder_and_potentiometer.h
+++ b/frc971/wpilib/encoder_and_potentiometer.h
@@ -4,8 +4,8 @@
 #include <atomic>
 #include <thread>
 
-#include "aos/common/macros.h"
-#include "aos/common/mutex.h"
+#include "aos/macros.h"
+#include "aos/mutex/mutex.h"
 
 #include "Encoder.h"
 #include "DigitalSource.h"
diff --git a/frc971/wpilib/gyro_interface.cc b/frc971/wpilib/gyro_interface.cc
index 9b7bb8b..a892d6a 100644
--- a/frc971/wpilib/gyro_interface.cc
+++ b/frc971/wpilib/gyro_interface.cc
@@ -3,8 +3,8 @@
 #include <inttypes.h>
 #include <chrono>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/time.h"
+#include "aos/logging/logging.h"
+#include "aos/time/time.h"
 
 #ifndef M_PI
 #define M_PI 3.14159265358979323846
diff --git a/frc971/wpilib/gyro_sender.cc b/frc971/wpilib/gyro_sender.cc
index 5128110..c210038 100644
--- a/frc971/wpilib/gyro_sender.cc
+++ b/frc971/wpilib/gyro_sender.cc
@@ -7,11 +7,11 @@
 
 #include <chrono>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/messages/robot_state.q.h"
-#include "aos/common/time.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/util/phased_loop.h"
+#include "aos/robot_state/robot_state.q.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
 
 #include "frc971/queues/gyro.q.h"
diff --git a/frc971/wpilib/interrupt_edge_counting.cc b/frc971/wpilib/interrupt_edge_counting.cc
index 3f81501..903296b 100644
--- a/frc971/wpilib/interrupt_edge_counting.cc
+++ b/frc971/wpilib/interrupt_edge_counting.cc
@@ -2,7 +2,7 @@
 
 #include <chrono>
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
 
 namespace frc971 {
diff --git a/frc971/wpilib/interrupt_edge_counting.h b/frc971/wpilib/interrupt_edge_counting.h
index 987e01d..e4eec35 100644
--- a/frc971/wpilib/interrupt_edge_counting.h
+++ b/frc971/wpilib/interrupt_edge_counting.h
@@ -6,8 +6,8 @@
 #include <thread>
 #include <vector>
 
-#include "aos/common/stl_mutex.h"
-#include "aos/common/macros.h"
+#include "aos/stl_mutex/stl_mutex.h"
+#include "aos/macros.h"
 
 #include "DigitalInput.h"
 #include "Encoder.h"
diff --git a/frc971/wpilib/joystick_sender.cc b/frc971/wpilib/joystick_sender.cc
index 741b49c..034b838 100644
--- a/frc971/wpilib/joystick_sender.cc
+++ b/frc971/wpilib/joystick_sender.cc
@@ -1,9 +1,9 @@
 #include "frc971/wpilib/joystick_sender.h"
 
-#include "aos/common/messages/robot_state.q.h"
+#include "aos/robot_state/robot_state.q.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/network/team_number.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/network/team_number.h"
+#include "aos/logging/queue_logging.h"
 
 #include "DriverStation.h"
 #if defined(WPILIB2017) || defined(WPILIB2018)
diff --git a/frc971/wpilib/loop_output_handler.cc b/frc971/wpilib/loop_output_handler.cc
index 59770be..dfe63d9 100644
--- a/frc971/wpilib/loop_output_handler.cc
+++ b/frc971/wpilib/loop_output_handler.cc
@@ -7,7 +7,7 @@
 #include <thread>
 
 #include "aos/linux_code/init.h"
-#include "aos/common/messages/robot_state.q.h"
+#include "aos/robot_state/robot_state.q.h"
 
 namespace frc971 {
 namespace wpilib {
diff --git a/frc971/wpilib/loop_output_handler.h b/frc971/wpilib/loop_output_handler.h
index 14a5cc5..27c96e7 100644
--- a/frc971/wpilib/loop_output_handler.h
+++ b/frc971/wpilib/loop_output_handler.h
@@ -4,9 +4,9 @@
 #include <atomic>
 #include <chrono>
 
-#include "aos/common/scoped_fd.h"
-#include "aos/common/time.h"
-#include "aos/common/util/log_interval.h"
+#include "aos/scoped/scoped_fd.h"
+#include "aos/time/time.h"
+#include "aos/util/log_interval.h"
 
 namespace frc971 {
 namespace wpilib {
diff --git a/frc971/wpilib/pdp_fetcher.cc b/frc971/wpilib/pdp_fetcher.cc
index 846de60..ae720e6 100644
--- a/frc971/wpilib/pdp_fetcher.cc
+++ b/frc971/wpilib/pdp_fetcher.cc
@@ -2,9 +2,9 @@
 
 #include <chrono>
 
-#include "aos/common/logging/queue_logging.h"
+#include "aos/logging/queue_logging.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/util/phased_loop.h"
+#include "aos/util/phased_loop.h"
 #include "frc971/wpilib/pdp_values.q.h"
 
 namespace frc971 {
diff --git a/frc971/wpilib/spi_rx_clearer.cc b/frc971/wpilib/spi_rx_clearer.cc
index fda8d7c..dfe7e8b 100644
--- a/frc971/wpilib/spi_rx_clearer.cc
+++ b/frc971/wpilib/spi_rx_clearer.cc
@@ -5,7 +5,7 @@
 #include <sys/mman.h>
 #include <unistd.h>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace frc971 {
 namespace wpilib {
diff --git a/frc971/wpilib/wpilib_interface.cc b/frc971/wpilib/wpilib_interface.cc
index c886907..8db81e1 100644
--- a/frc971/wpilib/wpilib_interface.cc
+++ b/frc971/wpilib/wpilib_interface.cc
@@ -1,7 +1,7 @@
 #include "frc971/wpilib/wpilib_interface.h"
 
-#include "aos/common/messages/robot_state.q.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/robot_state/robot_state.q.h"
+#include "aos/logging/queue_logging.h"
 
 #include <HAL/HAL.h>
 
diff --git a/frc971/zeroing/BUILD b/frc971/zeroing/BUILD
index 96315c7..db5507b 100644
--- a/frc971/zeroing/BUILD
+++ b/frc971/zeroing/BUILD
@@ -43,8 +43,8 @@
     ],
     deps = [
         ":zeroing",
-        "//aos/common:die",
-        "//aos/common/util:thread",
+        "//aos:die",
+        "//aos/util:thread",
         "//aos/testing:googletest",
         "//aos/testing:test_shm",
         "//frc971/control_loops:position_sensor_sim",
diff --git a/frc971/zeroing/zeroing_test.cc b/frc971/zeroing/zeroing_test.cc
index 549b3ed..7948bf4 100644
--- a/frc971/zeroing/zeroing_test.cc
+++ b/frc971/zeroing/zeroing_test.cc
@@ -8,8 +8,8 @@
 #include "frc971/zeroing/zeroing.h"
 #include "frc971/control_loops/control_loops.q.h"
 #include "aos/testing/test_shm.h"
-#include "aos/common/util/thread.h"
-#include "aos/common/die.h"
+#include "aos/util/thread.h"
+#include "aos/die.h"
 #include "frc971/control_loops/position_sensor_sim.h"
 
 namespace frc971 {
diff --git a/motors/fet12/fet12v2.cc b/motors/fet12/fet12v2.cc
index 5f8568b..a310170 100644
--- a/motors/fet12/fet12v2.cc
+++ b/motors/fet12/fet12v2.cc
@@ -196,7 +196,11 @@
   constexpr float kFuseAlpha = 0.95f;
 
   // 3400 - 760
-  static float filtered_throttle = 0.0f;
+  // Start the throttle filter at 1.0f--once it converges to near zero, we set
+  // throttle_zeroed to true and only then do we start listening to throttle
+  // commands.
+  static float filtered_throttle = 1.0f;
+  static bool throttle_zeroed = false;
   constexpr int kMaxThrottle = 3400;
   constexpr int kMinThrottle = 760;
   const float throttle = ::std::max(
@@ -208,6 +212,11 @@
 
   // y(n) = x(n) + a * (y(n-1) - x(n))
   filtered_throttle = throttle + kAlpha * (filtered_throttle - throttle);
+  if (::std::abs(filtered_throttle) < 1e-2f) {
+    // Once the filter gets near zero once, we start paying attention to it;
+    // once it gets near zero once, never ignore it again.
+    throttle_zeroed = true;
+  }
 
   const float fuse_voltage = static_cast<float>(adc_readings.fuse_voltage);
   static float filtered_fuse_voltage = 0.0f;
@@ -234,10 +243,20 @@
           (2.0f * 1.5f * static_cast<float>(kR)));
 
   constexpr float kNegativeCurrent = 80.0f;
-  float goal_current = -::std::min(
-      filtered_throttle * (kPeakCurrent + kNegativeCurrent) - kNegativeCurrent,
-      throttle_limit);
+  float goal_current =
+      -::std::min(
+          ::std::max(filtered_throttle * (kPeakCurrent + kNegativeCurrent) -
+                         kNegativeCurrent,
+                     -throttle_limit),
+          throttle_limit);
 
+  if (!throttle_zeroed) {
+    goal_current = 0.0f;
+  }
+
+  // Note: current reduction is 12/70 belt, 15 / 54 on chain, and 10 inch
+  // diameter wheels, so cutoff of 500 electrical rad/sec * 1 mechanical rad / 2
+  // erad * 12 / 70 * 15 / 54 * 0.127 m = 1.5m/s = 3.4 mph
   if (velocity > -500) {
     if (goal_current > 0.0f) {
       goal_current = 0.0f;
diff --git a/motors/pistol_grip/controller.cc b/motors/pistol_grip/controller.cc
index 2bb3e01..54d8f04 100644
--- a/motors/pistol_grip/controller.cc
+++ b/motors/pistol_grip/controller.cc
@@ -668,6 +668,21 @@
   return true;
 }
 
+// Returns an identifier for the processor we're running on.
+// This isn't guaranteed to be unique, but it should be close enough.
+uint8_t ProcessorIdentifier() {
+  // This XORs together all the bytes of the unique identifier provided by the
+  // hardware.
+  uint8_t r = 0;
+  for (uint8_t uid : {SIM_UIDH, SIM_UIDMH, SIM_UIDML, SIM_UIDL}) {
+    r = r ^ ((uid >> 0) & 0xFF);
+    r = r ^ ((uid >> 8) & 0xFF);
+    r = r ^ ((uid >> 16) & 0xFF);
+    r = r ^ ((uid >> 24) & 0xFF);
+  }
+  return r;
+}
+
 }  // namespace
 
 extern "C" int main() {
@@ -820,7 +835,7 @@
   printf("heap start: %p\n", __heap_start__);
   printf("stack start: %p\n", __stack_end__);
 
-  printf("Zeroing motors\n");
+  printf("Zeroing motors for %x\n", (unsigned int)ProcessorIdentifier());
   uint16_t motor0_offset, motor1_offset, wheel_offset;
   while (!ZeroMotors(&motor0_offset, &motor1_offset, &wheel_offset)) {
   }
diff --git a/motors/python/BUILD b/motors/python/BUILD
index 903b397..d5d74ae 100644
--- a/motors/python/BUILD
+++ b/motors/python/BUILD
@@ -3,6 +3,9 @@
     srcs = [
         "big_phase_current.py",
     ],
+    data = [
+        "@python_repo//:scipy",
+    ],
     legacy_create_init = False,
     restricted_to = ["//tools:k8"],
     deps = [
@@ -10,6 +13,7 @@
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
+        "@matplotlib",
     ],
 )
 
diff --git a/motors/python/big_phase_current.py b/motors/python/big_phase_current.py
index 7b967da..718d4d9 100755
--- a/motors/python/big_phase_current.py
+++ b/motors/python/big_phase_current.py
@@ -1,4 +1,6 @@
-#!/usr/bin/python3
+#!/usr/bin/python
+
+from __future__ import print_function
 
 import numpy
 from matplotlib import pylab
@@ -106,10 +108,10 @@
 # by to get motor current.
 one_amp_scalar = (phases(f_single, 0.0).T * phases(g_single, 0.0))[0, 0]
 
-print 'Max BEMF', max(f(theta_range))
-print 'Max current', max(g(theta_range))
-print 'Max drive voltage (one_amp_driving_voltage)', max(one_amp_driving_voltage)
-print 'one_amp_scalar', one_amp_scalar
+print('Max BEMF', max(f(theta_range)))
+print('Max current', max(g(theta_range)))
+print('Max drive voltage (one_amp_driving_voltage)', max(one_amp_driving_voltage))
+print('one_amp_scalar', one_amp_scalar)
 
 pylab.figure()
 pylab.subplot(1, 1, 1)
@@ -420,15 +422,15 @@
         controls.c2d(-self.A_model, self.B_model, 1.0 / hz)
     self.B_discrete_inverse_model = numpy.matrix(numpy.eye(3)) / (self.B_discrete_model[0, 0] - self.B_discrete_model[1, 0])
 
-    print 'constexpr double kL = %g;' % self.L_model
-    print 'constexpr double kM = %g;' % self.M_model
-    print 'constexpr double kR = %g;' % self.R_model
-    print 'constexpr float kAdiscrete_diagonal = %gf;' % self.A_discrete_model[0, 0]
-    print 'constexpr float kAdiscrete_offdiagonal = %gf;' % self.A_discrete_model[1, 0]
-    print 'constexpr float kBdiscrete_inv_diagonal = %gf;' % self.B_discrete_inverse_model[0, 0]
-    print 'constexpr float kBdiscrete_inv_offdiagonal = %gf;' % self.B_discrete_inverse_model[1, 0]
-    print 'constexpr double kOneAmpScalar = %g;' % one_amp_scalar
-    print 'constexpr double kMaxOneAmpDrivingVoltage = %g;' % max_one_amp_driving_voltage
+    print('constexpr double kL = %g;' % self.L_model)
+    print('constexpr double kM = %g;' % self.M_model)
+    print('constexpr double kR = %g;' % self.R_model)
+    print('constexpr float kAdiscrete_diagonal = %gf;' % self.A_discrete_model[0, 0])
+    print('constexpr float kAdiscrete_offdiagonal = %gf;' % self.A_discrete_model[1, 0])
+    print('constexpr float kBdiscrete_inv_diagonal = %gf;' % self.B_discrete_inverse_model[0, 0])
+    print('constexpr float kBdiscrete_inv_offdiagonal = %gf;' % self.B_discrete_inverse_model[1, 0])
+    print('constexpr double kOneAmpScalar = %g;' % one_amp_scalar)
+    print('constexpr double kMaxOneAmpDrivingVoltage = %g;' % max_one_amp_driving_voltage)
     print('A_discrete', self.A_discrete)
     print('B_discrete', self.B_discrete)
     print('B_discrete_sub', numpy.linalg.inv(self.B_discrete[0:2, 0:2]))
@@ -520,8 +522,8 @@
     # So, we now know how much the change in current is due to changes in BEMF.
     # Subtract that, and then run the stock statespace equation.
     Vn_ff = self.B_discrete_inverse * (Inext - self.A_discrete * (Icurrent - p) - p_next_imag.real)
-    print 'Vn_ff', Vn_ff
-    print 'Inext', Inext
+    print('Vn_ff', Vn_ff)
+    print('Inext', Inext)
     Vn = Vn_ff + self.K * (Icurrent - measured_current)
 
     E = phases(f_single, self.X[3, 0]) / Kv * self.X[4, 0]
@@ -568,7 +570,7 @@
 
         self.current_time = t
 
-    print 'Took %f to simulate' % (time.time() - start_wall_time)
+    print('Took %f to simulate' % (time.time() - start_wall_time))
 
     self.data_logger.plot()
 
diff --git a/motors/usb/BUILD b/motors/usb/BUILD
index c0600bf..a91dfcb 100644
--- a/motors/usb/BUILD
+++ b/motors/usb/BUILD
@@ -37,7 +37,7 @@
   ],
   deps = [
     ':constants',
-    '//aos/common:macros',
+    '//aos:macros',
     '//motors/core',
     '//motors:util',
   ],
diff --git a/motors/usb/usb.h b/motors/usb/usb.h
index 3b67a44..1273efd 100644
--- a/motors/usb/usb.h
+++ b/motors/usb/usb.h
@@ -7,7 +7,7 @@
 #include <vector>
 #include <memory>
 
-#include "aos/common/macros.h"
+#include "aos/macros.h"
 #include "motors/core/kinetis.h"
 #include "motors/usb/constants.h"
 #include "motors/util.h"
diff --git a/third_party/allwpilib_2017/BUILD b/third_party/allwpilib_2017/BUILD
index c15d5b5..31ac4a8 100644
--- a/third_party/allwpilib_2017/BUILD
+++ b/third_party/allwpilib_2017/BUILD
@@ -117,7 +117,7 @@
   deps = [
     '//third_party/ntcore_2017:ntcore',
     '@allwpilib_ni_libraries_repo_2017//:ni-libraries',
-    '//aos/common/logging',
+    '//aos/logging',
   ],
   hdrs = _h_hdrs + _hpp_hdrs + [
     'wpilibc/shared/include/CircularBuffer.inc',
diff --git a/third_party/allwpilib_2018/BUILD b/third_party/allwpilib_2018/BUILD
index 8254c8a..852f8b4 100644
--- a/third_party/allwpilib_2018/BUILD
+++ b/third_party/allwpilib_2018/BUILD
@@ -126,7 +126,7 @@
   deps = [
     '//third_party/ntcore_2018:ntcore',
     '@allwpilib_ni_libraries_repo_2018//:ni-libraries',
-    '//aos/common/logging',
+    '//aos/logging',
   ],
   hdrs = _h_hdrs + _hpp_hdrs + [
     'wpilibc/src/main/native/include/circular_buffer.inc',
diff --git a/y2012/BUILD b/y2012/BUILD
index 097ea57..acc60d4 100644
--- a/y2012/BUILD
+++ b/y2012/BUILD
@@ -6,10 +6,10 @@
         "joystick_reader.cc",
     ],
     deps = [
-        "//aos/common:time",
-        "//aos/common/actions:action_lib",
-        "//aos/common/logging",
-        "//aos/common/util:log_interval",
+        "//aos/time:time",
+        "//aos/actions:action_lib",
+        "//aos/logging",
+        "//aos/util:log_interval",
         "//aos/input:joystick_input",
         "//aos/linux_code:init",
         "//frc971/autonomous:auto_queue",
@@ -41,15 +41,15 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        "//aos/common:stl_mutex",
-        "//aos/common:time",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
-        "//aos/common/util:phased_loop",
-        "//aos/common/util:wrapping_counter",
+        "//aos/stl_mutex:stl_mutex",
+        "//aos/time:time",
+        "//aos/controls:control_loop",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
+        "//aos/util:phased_loop",
+        "//aos/util:wrapping_counter",
         "//aos/linux_code:init",
         "//frc971/control_loops:queues",
         "//frc971/control_loops/drivetrain:drivetrain_queue",
diff --git a/y2012/control_loops/accessories/BUILD b/y2012/control_loops/accessories/BUILD
index 921d694..878024a 100644
--- a/y2012/control_loops/accessories/BUILD
+++ b/y2012/control_loops/accessories/BUILD
@@ -10,7 +10,7 @@
   deps = [
     ':accessories_queue',
     '//aos/linux_code:init',
-    '//aos/common/controls:control_loop',
+    '//aos/controls:control_loop',
   ],
 )
 
@@ -20,6 +20,6 @@
     'accessories.q',
   ],
   deps = [
-    '//aos/common/controls:control_loop_queues',
+    '//aos/controls:control_loop_queues',
   ],
 )
diff --git a/y2012/control_loops/accessories/accessories.cc b/y2012/control_loops/accessories/accessories.cc
index 1c0dcbc..2bbe4c8 100644
--- a/y2012/control_loops/accessories/accessories.cc
+++ b/y2012/control_loops/accessories/accessories.cc
@@ -1,7 +1,7 @@
 #include "y2012/control_loops/accessories/accessories.q.h"
 
 #include "aos/linux_code/init.h"
-#include "aos/common/controls/control_loop.h"
+#include "aos/controls/control_loop.h"
 
 namespace y2012 {
 namespace control_loops {
diff --git a/y2012/control_loops/accessories/accessories.q b/y2012/control_loops/accessories/accessories.q
index 79f9820..dbcb33b 100644
--- a/y2012/control_loops/accessories/accessories.q
+++ b/y2012/control_loops/accessories/accessories.q
@@ -1,6 +1,6 @@
 package y2012.control_loops;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 
 queue_group AccessoriesQueue {
   implements aos.control_loops.ControlLoop;
diff --git a/y2012/joystick_reader.cc b/y2012/joystick_reader.cc
index 3b5bc48..30de49e 100644
--- a/y2012/joystick_reader.cc
+++ b/y2012/joystick_reader.cc
@@ -5,10 +5,10 @@
 
 #include "aos/linux_code/init.h"
 #include "aos/input/joystick_input.h"
-#include "aos/common/input/driver_station_data.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/time.h"
-#include "aos/common/actions/actions.h"
+#include "aos/input/driver_station_data.h"
+#include "aos/logging/logging.h"
+#include "aos/time/time.h"
+#include "aos/actions/actions.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2012/control_loops/accessories/accessories.q.h"
diff --git a/y2012/wpilib_interface.cc b/y2012/wpilib_interface.cc
index 59e715d..3f74fc1 100644
--- a/y2012/wpilib_interface.cc
+++ b/y2012/wpilib_interface.cc
@@ -21,15 +21,15 @@
 #include "PowerDistributionPanel.h"
 #undef ERROR
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/time.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/util/wrapping_counter.h"
-#include "aos/common/stl_mutex.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/time/time.h"
+#include "aos/util/log_interval.h"
+#include "aos/util/phased_loop.h"
+#include "aos/util/wrapping_counter.h"
+#include "aos/stl_mutex/stl_mutex.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/messages/robot_state.q.h"
+#include "aos/robot_state/robot_state.q.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "frc971/wpilib/buffered_pcm.h"
diff --git a/y2014/BUILD b/y2014/BUILD
index a57bb72..61a3c4f 100644
--- a/y2014/BUILD
+++ b/y2014/BUILD
@@ -11,9 +11,9 @@
     visibility = ["//visibility:public"],
     deps = [
         "//aos:once",
-        "//aos/common:mutex",
-        "//aos/common/logging",
-        "//aos/common/network:team_number",
+        "//aos/mutex:mutex",
+        "//aos/logging",
+        "//aos/network:team_number",
         "//frc971:shifter_hall_effect",
         "//frc971/control_loops:state_feedback_loop",
         "//y2014/control_loops/drivetrain:polydrivetrain_plants",
@@ -27,10 +27,10 @@
     ],
     deps = [
         ":constants",
-        "//aos/common:time",
-        "//aos/common/actions:action_lib",
-        "//aos/common/logging",
-        "//aos/common/util:log_interval",
+        "//aos/time:time",
+        "//aos/actions:action_lib",
+        "//aos/logging",
+        "//aos/util:log_interval",
         "//aos/input:joystick_input",
         "//aos/linux_code:init",
         "//frc971/autonomous:auto_queue",
@@ -67,9 +67,9 @@
         "hot_goal_reader.cc",
     ],
     deps = [
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
         "//aos/linux_code:init",
         "//y2014/queues:hot_goal",
     ],
@@ -83,15 +83,15 @@
     restricted_to = ["//tools:roborio"],
     deps = [
         ":constants",
-        "//aos/common:stl_mutex",
-        "//aos/common:time",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
-        "//aos/common/util:phased_loop",
-        "//aos/common/util:wrapping_counter",
+        "//aos/stl_mutex:stl_mutex",
+        "//aos/time:time",
+        "//aos/controls:control_loop",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
+        "//aos/util:phased_loop",
+        "//aos/util:wrapping_counter",
         "//aos/linux_code:init",
         "//frc971/control_loops:queues",
         "//frc971/control_loops/drivetrain:drivetrain_queue",
diff --git a/y2014/actors/BUILD b/y2014/actors/BUILD
index eb9e0f9..37de2c9 100644
--- a/y2014/actors/BUILD
+++ b/y2014/actors/BUILD
@@ -16,7 +16,7 @@
     'shoot_action.q',
   ],
   deps = [
-    '//aos/common/actions:action_queue',
+    '//aos/actions:action_queue',
   ],
 )
 
@@ -30,9 +30,9 @@
   ],
   deps = [
     ':shoot_action_queue',
-    '//aos/common/actions:action_lib',
+    '//aos/actions:action_lib',
     '//y2014/queues:profile_params',
-    '//aos/common/logging',
+    '//aos/logging',
     '//y2014/control_loops/shooter:shooter_queue',
     '//y2014/control_loops/claw:claw_queue',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
@@ -58,7 +58,7 @@
     'drivetrain_action.q',
   ],
   deps = [
-    '//aos/common/actions:action_queue',
+    '//aos/actions:action_queue',
   ],
 )
 
@@ -73,14 +73,14 @@
   deps = [
     ':drivetrain_action_queue',
     '//y2014:constants',
-    '//aos/common:time',
-    '//aos/common:math',
-    '//aos/common/util:phased_loop',
-    '//aos/common/logging',
-    '//aos/common/actions:action_lib',
-    '//aos/common/logging:queue_logging',
+    '//aos/time:time',
+    '//aos:math',
+    '//aos/util:phased_loop',
+    '//aos/logging',
+    '//aos/actions:action_lib',
+    '//aos/logging:queue_logging',
     '//third_party/eigen',
-    '//aos/common/util:trapezoid_profile',
+    '//aos/util:trapezoid_profile',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
     '//frc971/control_loops:state_feedback_loop',
   ],
diff --git a/y2014/actors/drivetrain_action.q b/y2014/actors/drivetrain_action.q
index 2f3eb15..458a3e5 100644
--- a/y2014/actors/drivetrain_action.q
+++ b/y2014/actors/drivetrain_action.q
@@ -1,6 +1,6 @@
 package y2014.actors;
 
-import "aos/common/actions/actions.q";
+import "aos/actions/actions.q";
 
 // Parameters to send with start.
 struct DrivetrainActionParams {
diff --git a/y2014/actors/drivetrain_actor.cc b/y2014/actors/drivetrain_actor.cc
index 418b591..6aec414 100644
--- a/y2014/actors/drivetrain_actor.cc
+++ b/y2014/actors/drivetrain_actor.cc
@@ -5,11 +5,11 @@
 
 #include <Eigen/Dense>
 
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/util/trapezoid_profile.h"
-#include "aos/common/commonmath.h"
-#include "aos/common/time.h"
+#include "aos/util/phased_loop.h"
+#include "aos/logging/logging.h"
+#include "aos/util/trapezoid_profile.h"
+#include "aos/commonmath.h"
+#include "aos/time/time.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2014/actors/drivetrain_actor.h"
diff --git a/y2014/actors/drivetrain_actor.h b/y2014/actors/drivetrain_actor.h
index 2a9e307..454a41e 100644
--- a/y2014/actors/drivetrain_actor.h
+++ b/y2014/actors/drivetrain_actor.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/actions/actor.h"
-#include "aos/common/actions/actions.h"
+#include "aos/actions/actor.h"
+#include "aos/actions/actions.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 
 #include "y2014/actors/drivetrain_action.q.h"
diff --git a/y2014/actors/shoot_action.q b/y2014/actors/shoot_action.q
index 9c56e99..ccf6dcf 100644
--- a/y2014/actors/shoot_action.q
+++ b/y2014/actors/shoot_action.q
@@ -1,6 +1,6 @@
 package y2014.actors;
 
-import "aos/common/actions/actions.q";
+import "aos/actions/actions.q";
 
 queue_group ShootActionQueueGroup {
   implements frc971.actions.ActionQueueGroup;
diff --git a/y2014/actors/shoot_actor.cc b/y2014/actors/shoot_actor.cc
index 743a4c3..ca5168f 100644
--- a/y2014/actors/shoot_actor.cc
+++ b/y2014/actors/shoot_actor.cc
@@ -2,7 +2,7 @@
 
 #include <functional>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 #include "y2014/control_loops/shooter/shooter.q.h"
 #include "y2014/control_loops/claw/claw.q.h"
diff --git a/y2014/actors/shoot_actor.h b/y2014/actors/shoot_actor.h
index 4ede888..804feee 100644
--- a/y2014/actors/shoot_actor.h
+++ b/y2014/actors/shoot_actor.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/actions/actor.h"
-#include "aos/common/actions/actions.h"
+#include "aos/actions/actor.h"
+#include "aos/actions/actions.h"
 
 #include "y2014/actors/shoot_action.q.h"
 
diff --git a/y2014/autonomous/BUILD b/y2014/autonomous/BUILD
index 984b110..7d171dc 100644
--- a/y2014/autonomous/BUILD
+++ b/y2014/autonomous/BUILD
@@ -10,20 +10,20 @@
   ],
   deps = [
     '//frc971/autonomous:auto_queue',
-    '//aos/common/controls:control_loop',
+    '//aos/controls:control_loop',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
     '//y2014/control_loops/shooter:shooter_queue',
     '//y2014/control_loops/claw:claw_queue',
     '//y2014:constants',
-    '//aos/common:time',
-    '//aos/common/util:phased_loop',
-    '//aos/common/util:trapezoid_profile',
-    '//aos/common/logging',
-    '//aos/common/actions:action_lib',
+    '//aos/time:time',
+    '//aos/util:phased_loop',
+    '//aos/util:trapezoid_profile',
+    '//aos/logging',
+    '//aos/actions:action_lib',
     '//y2014/actors:shoot_action_lib',
     '//y2014/actors:drivetrain_action_lib',
     '//y2014/queues:hot_goal',
-    '//aos/common/logging:queue_logging',
+    '//aos/logging:queue_logging',
     '//y2014/queues:profile_params',
     '//y2014/queues:auto_mode',
   ],
diff --git a/y2014/autonomous/auto.cc b/y2014/autonomous/auto.cc
index 96c7132..e5bd9bc 100644
--- a/y2014/autonomous/auto.cc
+++ b/y2014/autonomous/auto.cc
@@ -3,12 +3,12 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/time.h"
-#include "aos/common/util/trapezoid_profile.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/actions/actions.h"
+#include "aos/util/phased_loop.h"
+#include "aos/time/time.h"
+#include "aos/util/trapezoid_profile.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/actions/actions.h"
 
 #include "frc971/autonomous/auto.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
diff --git a/y2014/autonomous/auto_main.cc b/y2014/autonomous/auto_main.cc
index 747747a..81c5d34 100644
--- a/y2014/autonomous/auto_main.cc
+++ b/y2014/autonomous/auto_main.cc
@@ -1,8 +1,8 @@
 #include <stdio.h>
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "frc971/autonomous/auto.q.h"
 #include "y2014/autonomous/auto.h"
 
diff --git a/y2014/constants.cc b/y2014/constants.cc
index 8354e57..6981e48 100644
--- a/y2014/constants.cc
+++ b/y2014/constants.cc
@@ -10,9 +10,9 @@
 #include "sanitizer/lsan_interface.h"
 #endif
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/mutex.h"
-#include "aos/common/network/team_number.h"
+#include "aos/logging/logging.h"
+#include "aos/mutex/mutex.h"
+#include "aos/network/team_number.h"
 #include "aos/once.h"
 
 #include "y2014/control_loops/drivetrain/polydrivetrain_dog_motor_plant.h"
diff --git a/y2014/control_loops/claw/BUILD b/y2014/control_loops/claw/BUILD
index 1c0d157..252edce 100644
--- a/y2014/control_loops/claw/BUILD
+++ b/y2014/control_loops/claw/BUILD
@@ -9,7 +9,7 @@
   ],
   deps = [
     ':claw_queue',
-    '//aos/common/controls:replay_control_loop',
+    '//aos/controls:replay_control_loop',
     '//aos/linux_code:init',
   ],
 )
@@ -20,7 +20,7 @@
     'claw.q',
   ],
   deps = [
-    '//aos/common/controls:control_loop_queues',
+    '//aos/controls:control_loop_queues',
     '//frc971/control_loops:queues',
   ],
 )
@@ -50,11 +50,11 @@
   ],
   deps = [
     ':claw_queue',
-    '//aos/common/controls:control_loop',
-    '//aos/common/controls:polytope',
-    '//aos/common/logging:queue_logging',
-    '//aos/common/logging:matrix_logging',
-    '//aos/common:math',
+    '//aos/controls:control_loop',
+    '//aos/controls:polytope',
+    '//aos/logging:queue_logging',
+    '//aos/logging:matrix_logging',
+    '//aos:math',
     '//frc971/control_loops:state_feedback_loop',
     '//frc971/control_loops:coerce_goal',
     '//frc971/control_loops:hall_effect_tracker',
@@ -73,7 +73,7 @@
   deps = [
     ':claw_lib',
     ':claw_queue',
-    '//aos/common/controls:control_loop_test',
+    '//aos/controls:control_loop_test',
     '//aos/testing:googletest',
     '//frc971/control_loops:state_feedback_loop',
     '//frc971/control_loops:team_number_test_environment',
@@ -88,7 +88,7 @@
   deps = [
     '//aos/linux_code:init',
     ':claw_queue',
-    '//aos/common/controls:control_loop',
+    '//aos/controls:control_loop',
     '//y2014:constants',
   ],
 )
diff --git a/y2014/control_loops/claw/claw.cc b/y2014/control_loops/claw/claw.cc
index 11dbd80..088472c 100644
--- a/y2014/control_loops/claw/claw.cc
+++ b/y2014/control_loops/claw/claw.cc
@@ -2,11 +2,11 @@
 
 #include <algorithm>
 
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/logging/matrix_logging.h"
-#include "aos/common/commonmath.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/logging/matrix_logging.h"
+#include "aos/commonmath.h"
 
 #include "y2014/constants.h"
 #include "y2014/control_loops/claw/claw_motor_plant.h"
diff --git a/y2014/control_loops/claw/claw.h b/y2014/control_loops/claw/claw.h
index 88f038f..7995512 100644
--- a/y2014/control_loops/claw/claw.h
+++ b/y2014/control_loops/claw/claw.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/controls/polytope.h"
+#include "aos/controls/control_loop.h"
+#include "aos/controls/polytope.h"
 #include "y2014/constants.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 #include "frc971/control_loops/coerce_goal.h"
diff --git a/y2014/control_loops/claw/claw.q b/y2014/control_loops/claw/claw.q
index 1afdd85..efe445d 100644
--- a/y2014/control_loops/claw/claw.q
+++ b/y2014/control_loops/claw/claw.q
@@ -1,6 +1,6 @@
 package y2014.control_loops;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/control_loops.q";
 
 struct HalfClawPosition {
diff --git a/y2014/control_loops/claw/claw_lib_test.cc b/y2014/control_loops/claw/claw_lib_test.cc
index 8a7e9c3..753c087 100644
--- a/y2014/control_loops/claw/claw_lib_test.cc
+++ b/y2014/control_loops/claw/claw_lib_test.cc
@@ -3,7 +3,7 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/controls/control_loop_test.h"
+#include "aos/controls/control_loop_test.h"
 #include "frc971/control_loops/team_number_test_environment.h"
 #include "gtest/gtest.h"
 #include "y2014/constants.h"
diff --git a/y2014/control_loops/claw/replay_claw.cc b/y2014/control_loops/claw/replay_claw.cc
index 15cc9d9..21b44dd 100644
--- a/y2014/control_loops/claw/replay_claw.cc
+++ b/y2014/control_loops/claw/replay_claw.cc
@@ -1,4 +1,4 @@
-#include "aos/common/controls/replay_control_loop.h"
+#include "aos/controls/replay_control_loop.h"
 #include "aos/linux_code/init.h"
 
 #include "y2014/control_loops/claw/claw.q.h"
diff --git a/y2014/control_loops/shooter/BUILD b/y2014/control_loops/shooter/BUILD
index 6ab2a8b..c7e9ccc 100644
--- a/y2014/control_loops/shooter/BUILD
+++ b/y2014/control_loops/shooter/BUILD
@@ -9,7 +9,7 @@
   ],
   deps = [
     ':shooter_queue',
-    '//aos/common/controls:replay_control_loop',
+    '//aos/controls:replay_control_loop',
     '//aos/linux_code:init',
   ],
 )
@@ -20,7 +20,7 @@
     'shooter.q',
   ],
   deps = [
-    '//aos/common/controls:control_loop_queues',
+    '//aos/controls:control_loop_queues',
     '//frc971/control_loops:queues',
   ],
 )
@@ -54,10 +54,10 @@
   ],
   deps = [
     ':shooter_queue',
-    '//aos/common/controls:control_loop',
+    '//aos/controls:control_loop',
     '//y2014:constants',
     '//frc971/control_loops:state_feedback_loop',
-    '//aos/common/logging:queue_logging',
+    '//aos/logging:queue_logging',
   ],
   linkopts = [
     '-lm',
@@ -72,7 +72,7 @@
   deps = [
     ':shooter_lib',
     ':shooter_queue',
-    '//aos/common/controls:control_loop_test',
+    '//aos/controls:control_loop_test',
     '//aos/testing:googletest',
     '//frc971/control_loops:state_feedback_loop',
     '//frc971/control_loops:team_number_test_environment',
diff --git a/y2014/control_loops/shooter/replay_shooter.cc b/y2014/control_loops/shooter/replay_shooter.cc
index 1263f8a..2f42875 100644
--- a/y2014/control_loops/shooter/replay_shooter.cc
+++ b/y2014/control_loops/shooter/replay_shooter.cc
@@ -1,4 +1,4 @@
-#include "aos/common/controls/replay_control_loop.h"
+#include "aos/controls/replay_control_loop.h"
 #include "aos/linux_code/init.h"
 
 #include "y2014/control_loops/shooter/shooter.q.h"
diff --git a/y2014/control_loops/shooter/shooter.cc b/y2014/control_loops/shooter/shooter.cc
index 70a6cad..e2f104c 100644
--- a/y2014/control_loops/shooter/shooter.cc
+++ b/y2014/control_loops/shooter/shooter.cc
@@ -6,9 +6,9 @@
 #include <limits>
 #include <chrono>
 
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
 
 #include "y2014/constants.h"
 #include "y2014/control_loops/shooter/shooter_motor_plant.h"
diff --git a/y2014/control_loops/shooter/shooter.h b/y2014/control_loops/shooter/shooter.h
index f2ddbc8..0530012 100644
--- a/y2014/control_loops/shooter/shooter.h
+++ b/y2014/control_loops/shooter/shooter.h
@@ -3,9 +3,9 @@
 
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
+#include "aos/controls/control_loop.h"
 #include "frc971/control_loops/state_feedback_loop.h"
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 
 #include "y2014/constants.h"
 #include "y2014/control_loops/shooter/shooter_motor_plant.h"
diff --git a/y2014/control_loops/shooter/shooter.q b/y2014/control_loops/shooter/shooter.q
index ab8f590..5624d84 100644
--- a/y2014/control_loops/shooter/shooter.q
+++ b/y2014/control_loops/shooter/shooter.q
@@ -1,6 +1,6 @@
 package y2014.control_loops;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/control_loops.q";
 
 queue_group ShooterQueue {
diff --git a/y2014/control_loops/shooter/shooter_lib_test.cc b/y2014/control_loops/shooter/shooter_lib_test.cc
index 851e617..2869331 100644
--- a/y2014/control_loops/shooter/shooter_lib_test.cc
+++ b/y2014/control_loops/shooter/shooter_lib_test.cc
@@ -3,8 +3,8 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/controls/control_loop_test.h"
-#include "aos/common/network/team_number.h"
+#include "aos/controls/control_loop_test.h"
+#include "aos/network/team_number.h"
 #include "frc971/control_loops/team_number_test_environment.h"
 #include "gtest/gtest.h"
 #include "y2014/constants.h"
diff --git a/y2014/hot_goal_reader.cc b/y2014/hot_goal_reader.cc
index 6c76c12..14538a2 100644
--- a/y2014/hot_goal_reader.cc
+++ b/y2014/hot_goal_reader.cc
@@ -6,11 +6,11 @@
 #include <arpa/inet.h>
 #include <unistd.h>
 
-#include "aos/common/time.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/logging/logging.h"
+#include "aos/time/time.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/logging/logging.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/byteorder.h"
+#include "aos/byteorder.h"
 
 #include "y2014/queues/hot_goal.q.h"
 
diff --git a/y2014/joystick_reader.cc b/y2014/joystick_reader.cc
index 7516c97..e485d2e 100644
--- a/y2014/joystick_reader.cc
+++ b/y2014/joystick_reader.cc
@@ -5,11 +5,11 @@
 
 #include "aos/linux_code/init.h"
 #include "aos/input/joystick_input.h"
-#include "aos/common/input/driver_station_data.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/time.h"
-#include "aos/common/actions/actions.h"
+#include "aos/input/driver_station_data.h"
+#include "aos/logging/logging.h"
+#include "aos/util/log_interval.h"
+#include "aos/time/time.h"
+#include "aos/actions/actions.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2014/constants.h"
diff --git a/y2014/wpilib_interface.cc b/y2014/wpilib_interface.cc
index d5f7e5e..a97b758 100644
--- a/y2014/wpilib_interface.cc
+++ b/y2014/wpilib_interface.cc
@@ -20,15 +20,15 @@
 #endif
 #undef ERROR
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/time.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/util/wrapping_counter.h"
-#include "aos/common/stl_mutex.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/time/time.h"
+#include "aos/util/log_interval.h"
+#include "aos/util/phased_loop.h"
+#include "aos/util/wrapping_counter.h"
+#include "aos/stl_mutex/stl_mutex.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/messages/robot_state.q.h"
+#include "aos/robot_state/robot_state.q.h"
 
 #include "frc971/shifter_hall_effect.h"
 
diff --git a/y2014_bot3/BUILD b/y2014_bot3/BUILD
index 6f454ea..3da2637 100644
--- a/y2014_bot3/BUILD
+++ b/y2014_bot3/BUILD
@@ -6,10 +6,10 @@
         "joystick_reader.cc",
     ],
     deps = [
-        "//aos/common:time",
-        "//aos/common/actions:action_lib",
-        "//aos/common/logging",
-        "//aos/common/util:log_interval",
+        "//aos/time:time",
+        "//aos/actions:action_lib",
+        "//aos/logging",
+        "//aos/util:log_interval",
         "//aos/input:joystick_input",
         "//aos/linux_code:init",
         "//frc971/control_loops/drivetrain:drivetrain_queue",
@@ -42,15 +42,15 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        "//aos/common:stl_mutex",
-        "//aos/common:time",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
-        "//aos/common/util:phased_loop",
-        "//aos/common/util:wrapping_counter",
+        "//aos/stl_mutex:stl_mutex",
+        "//aos/time:time",
+        "//aos/controls:control_loop",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
+        "//aos/util:phased_loop",
+        "//aos/util:wrapping_counter",
         "//aos/linux_code:init",
         "//frc971/control_loops:queues",
         "//frc971/control_loops/drivetrain:drivetrain_queue",
diff --git a/y2014_bot3/actions/drivetrain_action.cc b/y2014_bot3/actions/drivetrain_action.cc
index d7660b3..22c668e 100644
--- a/y2014_bot3/actions/drivetrain_action.cc
+++ b/y2014_bot3/actions/drivetrain_action.cc
@@ -3,10 +3,10 @@
 
 #include <Eigen/Dense>
 
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/util/trapezoid_profile.h"
-#include "aos/common/commonmath.h"
+#include "aos/util/phased_loop.h"
+#include "aos/logging/logging.h"
+#include "aos/util/trapezoid_profile.h"
+#include "aos/commonmath.h"
 
 #include "bot3/actions/drivetrain_action.h"
 #include "bot3/control_loops/drivetrain/drivetrain.q.h"
diff --git a/y2014_bot3/actions/drivetrain_action_main.cc b/y2014_bot3/actions/drivetrain_action_main.cc
index 6a897e1..3c9f561 100644
--- a/y2014_bot3/actions/drivetrain_action_main.cc
+++ b/y2014_bot3/actions/drivetrain_action_main.cc
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "aos/linux_code/init.h"
 #include "bot3/actions/drivetrain_action.h"
 #include "frc971/actions/drivetrain_action.q.h"
diff --git a/y2014_bot3/autonomous/BUILD b/y2014_bot3/autonomous/BUILD
index 77a168a..c3c3292 100644
--- a/y2014_bot3/autonomous/BUILD
+++ b/y2014_bot3/autonomous/BUILD
@@ -19,14 +19,14 @@
   ],
   deps = [
     ':auto_queue',
-    '//aos/common/controls:control_loop',
+    '//aos/controls:control_loop',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
     '//y2014_bot3/control_loops/rollers:rollers_queue',
-    '//aos/common:time',
-    '//aos/common/util:phased_loop',
-    '//aos/common/util:trapezoid_profile',
-    '//aos/common/logging',
-    '//aos/common/logging:queue_logging',
+    '//aos/time:time',
+    '//aos/util:phased_loop',
+    '//aos/util:trapezoid_profile',
+    '//aos/logging',
+    '//aos/logging:queue_logging',
   ],
 )
 
diff --git a/y2014_bot3/autonomous/auto.cc b/y2014_bot3/autonomous/auto.cc
index 6b63fab..6cdaafd 100644
--- a/y2014_bot3/autonomous/auto.cc
+++ b/y2014_bot3/autonomous/auto.cc
@@ -3,11 +3,11 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/time.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/util/trapezoid_profile.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/time/time.h"
+#include "aos/util/phased_loop.h"
+#include "aos/util/trapezoid_profile.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2014_bot3/autonomous/auto.q.h"
 #include "y2014_bot3/control_loops/rollers/rollers.q.h"
diff --git a/y2014_bot3/autonomous/auto_main.cc b/y2014_bot3/autonomous/auto_main.cc
index 32c8cca..0697b9d 100644
--- a/y2014_bot3/autonomous/auto_main.cc
+++ b/y2014_bot3/autonomous/auto_main.cc
@@ -1,8 +1,8 @@
 #include <stdio.h>
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "y2014_bot3/autonomous/auto.q.h"
 #include "y2014_bot3/autonomous/auto.h"
 
diff --git a/y2014_bot3/control_loops/rollers/BUILD b/y2014_bot3/control_loops/rollers/BUILD
index 548b375..029c190 100644
--- a/y2014_bot3/control_loops/rollers/BUILD
+++ b/y2014_bot3/control_loops/rollers/BUILD
@@ -8,7 +8,7 @@
     'rollers.q',
   ],
   deps = [
-    '//aos/common/controls:control_loop_queues',
+    '//aos/controls:control_loop_queues',
     '//frc971/control_loops:queues',
   ],
 )
@@ -23,8 +23,8 @@
   ],
   deps = [
     ':rollers_queue',
-    '//aos/common/logging',
-    '//aos/common/controls:control_loop',
+    '//aos/logging',
+    '//aos/controls:control_loop',
   ],
 )
 
diff --git a/y2014_bot3/control_loops/rollers/rollers.cc b/y2014_bot3/control_loops/rollers/rollers.cc
index ef895b3..573a41f 100644
--- a/y2014_bot3/control_loops/rollers/rollers.cc
+++ b/y2014_bot3/control_loops/rollers/rollers.cc
@@ -1,6 +1,6 @@
 #include "y2014_bot3/control_loops/rollers/rollers.h"
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 
 namespace y2014_bot3 {
 namespace control_loops {
diff --git a/y2014_bot3/control_loops/rollers/rollers.h b/y2014_bot3/control_loops/rollers/rollers.h
index f0cae13..edbea7a 100644
--- a/y2014_bot3/control_loops/rollers/rollers.h
+++ b/y2014_bot3/control_loops/rollers/rollers.h
@@ -1,7 +1,7 @@
 #ifndef Y2014_BOT3_CONTROL_LOOPS_ROLLERS_H_
 #define Y2014_BOT3_CONTROL_LOOPS_ROLLERS_H_
 
-#include "aos/common/controls/control_loop.h"
+#include "aos/controls/control_loop.h"
 
 #include "y2014_bot3/control_loops/rollers/rollers.q.h"
 
diff --git a/y2014_bot3/control_loops/rollers/rollers.q b/y2014_bot3/control_loops/rollers/rollers.q
index f218a41..e36d43e 100644
--- a/y2014_bot3/control_loops/rollers/rollers.q
+++ b/y2014_bot3/control_loops/rollers/rollers.q
@@ -1,6 +1,6 @@
 package y2014_bot3.control_loops;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/control_loops.q";
 
 queue_group RollersQueue {
diff --git a/y2014_bot3/joystick_reader.cc b/y2014_bot3/joystick_reader.cc
index b4126d1..84359b5 100644
--- a/y2014_bot3/joystick_reader.cc
+++ b/y2014_bot3/joystick_reader.cc
@@ -5,10 +5,10 @@
 
 #include "aos/linux_code/init.h"
 #include "aos/input/joystick_input.h"
-#include "aos/common/input/driver_station_data.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/time.h"
+#include "aos/input/driver_station_data.h"
+#include "aos/logging/logging.h"
+#include "aos/util/log_interval.h"
+#include "aos/time/time.h"
 
 #include "frc971/queues/gyro.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
diff --git a/y2014_bot3/output/motor_writer.cc b/y2014_bot3/output/motor_writer.cc
index c623dba..89a69e0 100644
--- a/y2014_bot3/output/motor_writer.cc
+++ b/y2014_bot3/output/motor_writer.cc
@@ -3,12 +3,12 @@
 #include <unistd.h>
 
 #include "aos/output/motor_output.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/time.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/controls/output_check.q.h"
+#include "aos/util/log_interval.h"
+#include "aos/time/time.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/controls/output_check.q.h"
 
 #include "bot3/control_loops/drivetrain/drivetrain.q.h"
 #include "bot3/control_loops/rollers/rollers.q.h"
diff --git a/y2014_bot3/wpilib_interface.cc b/y2014_bot3/wpilib_interface.cc
index 5165ce9..fcdd731 100644
--- a/y2014_bot3/wpilib_interface.cc
+++ b/y2014_bot3/wpilib_interface.cc
@@ -18,15 +18,15 @@
 #include "DigitalInput.h"
 #undef ERROR
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/time.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/util/wrapping_counter.h"
-#include "aos/common/stl_mutex.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/time/time.h"
+#include "aos/util/log_interval.h"
+#include "aos/util/phased_loop.h"
+#include "aos/util/wrapping_counter.h"
+#include "aos/stl_mutex/stl_mutex.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/messages/robot_state.q.h"
+#include "aos/robot_state/robot_state.q.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2014_bot3/control_loops/drivetrain/drivetrain_base.h"
diff --git a/y2016/BUILD b/y2016/BUILD
index 24f83e1..e839562 100644
--- a/y2016/BUILD
+++ b/y2016/BUILD
@@ -14,9 +14,9 @@
     visibility = ["//visibility:public"],
     deps = [
         "//aos:once",
-        "//aos/common:mutex",
-        "//aos/common/logging",
-        "//aos/common/network:team_number",
+        "//aos/mutex:mutex",
+        "//aos/logging",
+        "//aos/network:team_number",
         "//frc971:constants",
         "//frc971:shifter_hall_effect",
         "//frc971/control_loops:state_feedback_loop",
@@ -31,10 +31,10 @@
     ],
     deps = [
         ":constants",
-        "//aos/common:time",
-        "//aos/common/actions:action_lib",
-        "//aos/common/logging",
-        "//aos/common/util:log_interval",
+        "//aos/time:time",
+        "//aos/actions:action_lib",
+        "//aos/logging",
+        "//aos/util:log_interval",
         "//aos/input:joystick_input",
         "//aos/linux_code:init",
         "//frc971/autonomous:auto_queue",
@@ -106,16 +106,16 @@
     restricted_to = ["//tools:roborio"],
     deps = [
         ":constants",
-        "//aos/common:math",
-        "//aos/common:stl_mutex",
-        "//aos/common:time",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
-        "//aos/common/util:phased_loop",
-        "//aos/common/util:wrapping_counter",
+        "//aos:math",
+        "//aos/stl_mutex:stl_mutex",
+        "//aos/time:time",
+        "//aos/controls:control_loop",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
+        "//aos/util:phased_loop",
+        "//aos/util:wrapping_counter",
         "//aos/linux_code:init",
         "//frc971/autonomous:auto_queue",
         "//frc971/control_loops:queues",
diff --git a/y2016/actors/BUILD b/y2016/actors/BUILD
index b21722a..89431c1 100644
--- a/y2016/actors/BUILD
+++ b/y2016/actors/BUILD
@@ -16,7 +16,7 @@
     'superstructure_action.q',
   ],
   deps = [
-    '//aos/common/actions:action_queue',
+    '//aos/actions:action_queue',
   ],
 )
 
@@ -30,9 +30,9 @@
   ],
   deps = [
     ':superstructure_action_queue',
-    '//aos/common/util:phased_loop',
-    '//aos/common/logging',
-    '//aos/common/actions:action_lib',
+    '//aos/util:phased_loop',
+    '//aos/logging',
+    '//aos/actions:action_lib',
     '//y2016/control_loops/superstructure:superstructure_queue',
   ],
 )
@@ -59,9 +59,9 @@
   ],
   deps = [
     ':vision_align_action_lib',
-    '//aos/common/util:phased_loop',
-    '//aos/common/logging',
-    '//aos/common/actions:action_lib',
+    '//aos/util:phased_loop',
+    '//aos/logging',
+    '//aos/actions:action_lib',
     '//frc971/autonomous:base_autonomous_actor',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
     '//y2016/queues:ball_detector',
@@ -90,7 +90,7 @@
     'vision_align_action.q',
   ],
   deps = [
-    '//aos/common/actions:action_queue',
+    '//aos/actions:action_queue',
   ],
 )
 
@@ -104,13 +104,13 @@
   ],
   deps = [
     ':vision_align_action_queue',
-    '//aos/common:time',
-    '//aos/common:math',
-    '//aos/common/util:phased_loop',
-    '//aos/common/logging',
-    '//aos/common/actions:action_lib',
-    '//aos/common/logging:queue_logging',
-    '//aos/common/util:trapezoid_profile',
+    '//aos/time:time',
+    '//aos:math',
+    '//aos/util:phased_loop',
+    '//aos/logging',
+    '//aos/actions:action_lib',
+    '//aos/logging:queue_logging',
+    '//aos/util:trapezoid_profile',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
     '//third_party/eigen',
     '//y2016:constants',
diff --git a/y2016/actors/autonomous_actor.cc b/y2016/actors/autonomous_actor.cc
index 727f5de..ea90944 100644
--- a/y2016/actors/autonomous_actor.cc
+++ b/y2016/actors/autonomous_actor.cc
@@ -5,8 +5,8 @@
 #include <chrono>
 #include <cmath>
 
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/logging/logging.h"
+#include "aos/util/phased_loop.h"
+#include "aos/logging/logging.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2016/control_loops/drivetrain/drivetrain_base.h"
diff --git a/y2016/actors/autonomous_actor.h b/y2016/actors/autonomous_actor.h
index 24df091..0a8eae2 100644
--- a/y2016/actors/autonomous_actor.h
+++ b/y2016/actors/autonomous_actor.h
@@ -4,8 +4,8 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/actions/actions.h"
-#include "aos/common/actions/actor.h"
+#include "aos/actions/actions.h"
+#include "aos/actions/actor.h"
 #include "frc971/autonomous/base_autonomous_actor.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain_config.h"
diff --git a/y2016/actors/superstructure_action.q b/y2016/actors/superstructure_action.q
index 231f5e7..eb23397 100644
--- a/y2016/actors/superstructure_action.q
+++ b/y2016/actors/superstructure_action.q
@@ -1,6 +1,6 @@
 package y2016.actors;
 
-import "aos/common/actions/actions.q";
+import "aos/actions/actions.q";
 
 // Parameters to send with start.
 struct SuperstructureActionParams {
diff --git a/y2016/actors/superstructure_actor.cc b/y2016/actors/superstructure_actor.cc
index d621b9d..d8537ce 100644
--- a/y2016/actors/superstructure_actor.cc
+++ b/y2016/actors/superstructure_actor.cc
@@ -2,8 +2,8 @@
 
 #include <cmath>
 
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/logging/logging.h"
+#include "aos/util/phased_loop.h"
+#include "aos/logging/logging.h"
 #include "y2016/actors/superstructure_actor.h"
 #include "y2016/control_loops/superstructure/superstructure.q.h"
 
diff --git a/y2016/actors/superstructure_actor.h b/y2016/actors/superstructure_actor.h
index 4d5e372..d48fc71 100644
--- a/y2016/actors/superstructure_actor.h
+++ b/y2016/actors/superstructure_actor.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/actions/actor.h"
-#include "aos/common/actions/actions.h"
+#include "aos/actions/actor.h"
+#include "aos/actions/actions.h"
 #include "y2016/actors/superstructure_action.q.h"
 
 namespace y2016 {
diff --git a/y2016/actors/vision_align_action.q b/y2016/actors/vision_align_action.q
index 742d936..e822bf4 100644
--- a/y2016/actors/vision_align_action.q
+++ b/y2016/actors/vision_align_action.q
@@ -1,6 +1,6 @@
 package y2016.actors;
 
-import "aos/common/actions/actions.q";
+import "aos/actions/actions.q";
 
 // Parameters to send with start.
 struct VisionAlignActionParams {
diff --git a/y2016/actors/vision_align_actor.cc b/y2016/actors/vision_align_actor.cc
index 0c9a2d9..f921c8e 100644
--- a/y2016/actors/vision_align_actor.cc
+++ b/y2016/actors/vision_align_actor.cc
@@ -6,11 +6,11 @@
 
 #include <Eigen/Dense>
 
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/util/trapezoid_profile.h"
-#include "aos/common/commonmath.h"
-#include "aos/common/time.h"
+#include "aos/util/phased_loop.h"
+#include "aos/logging/logging.h"
+#include "aos/util/trapezoid_profile.h"
+#include "aos/commonmath.h"
+#include "aos/time/time.h"
 
 #include "y2016/actors/vision_align_actor.h"
 #include "y2016/constants.h"
diff --git a/y2016/actors/vision_align_actor.h b/y2016/actors/vision_align_actor.h
index 5c9a812..a1f07fa 100644
--- a/y2016/actors/vision_align_actor.h
+++ b/y2016/actors/vision_align_actor.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/actions/actor.h"
-#include "aos/common/actions/actions.h"
+#include "aos/actions/actor.h"
+#include "aos/actions/actions.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 
 #include "y2016/actors/vision_align_action.q.h"
diff --git a/y2016/constants.cc b/y2016/constants.cc
index 8bbda56..d4f61c1 100644
--- a/y2016/constants.cc
+++ b/y2016/constants.cc
@@ -10,9 +10,9 @@
 #include "sanitizer/lsan_interface.h"
 #endif
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/mutex.h"
-#include "aos/common/network/team_number.h"
+#include "aos/logging/logging.h"
+#include "aos/mutex/mutex.h"
+#include "aos/network/team_number.h"
 #include "aos/once.h"
 
 #include "y2016/control_loops/drivetrain/polydrivetrain_dog_motor_plant.h"
diff --git a/y2016/control_loops/python/BUILD b/y2016/control_loops/python/BUILD
index adb3150..08a34e8 100644
--- a/y2016/control_loops/python/BUILD
+++ b/y2016/control_loops/python/BUILD
@@ -70,7 +70,7 @@
     restricted_to = ["//tools:k8"],
     deps = [
         ":python_init",
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
@@ -87,7 +87,7 @@
     restricted_to = ["//tools:k8"],
     deps = [
         ":python_init",
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
@@ -104,7 +104,7 @@
     restricted_to = ["//tools:k8"],
     deps = [
         ":python_init",
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
@@ -119,7 +119,7 @@
     ],
     restricted_to = ["//tools:k8"],
     deps = [
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
@@ -133,7 +133,7 @@
     ],
     restricted_to = ["//tools:k8"],
     deps = [
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
@@ -150,7 +150,7 @@
     deps = [
         ":shoulder_lib",
         ":wrist_lib",
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
@@ -169,7 +169,7 @@
         ":python_init",
         ":shoulder_lib",
         ":wrist_lib",
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
diff --git a/y2016/control_loops/python/arm.py b/y2016/control_loops/python/arm.py
index 8908038..5c5793b 100755
--- a/y2016/control_loops/python/arm.py
+++ b/y2016/control_loops/python/arm.py
@@ -9,7 +9,7 @@
 
 from y2016.control_loops.python.shoulder import Shoulder, IntegralShoulder
 from y2016.control_loops.python.wrist import Wrist, IntegralWrist
-from aos.common.util.trapezoid_profile import TrapezoidProfile
+from aos.util.trapezoid_profile import TrapezoidProfile
 
 from matplotlib import pylab
 import gflags
diff --git a/y2016/control_loops/python/intake.py b/y2016/control_loops/python/intake.py
index 02c1ada..abb755c 100755
--- a/y2016/control_loops/python/intake.py
+++ b/y2016/control_loops/python/intake.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-from aos.common.util.trapezoid_profile import TrapezoidProfile
+from aos.util.trapezoid_profile import TrapezoidProfile
 from frc971.control_loops.python import control_loop
 from frc971.control_loops.python import controls
 import numpy
diff --git a/y2016/control_loops/shooter/BUILD b/y2016/control_loops/shooter/BUILD
index ad967d3..794a35b 100644
--- a/y2016/control_loops/shooter/BUILD
+++ b/y2016/control_loops/shooter/BUILD
@@ -8,7 +8,7 @@
     'shooter.q',
   ],
   deps = [
-    '//aos/common/controls:control_loop_queues',
+    '//aos/controls:control_loop_queues',
     '//frc971/control_loops:queues',
   ],
 )
@@ -54,7 +54,7 @@
   deps = [
     ':shooter_queue',
     ':shooter_plants',
-    '//aos/common/controls:control_loop',
+    '//aos/controls:control_loop',
   ],
 )
 
@@ -67,8 +67,8 @@
     ':shooter_queue',
     ':shooter_lib',
     '//aos/testing:googletest',
-    '//aos/common:queues',
-    '//aos/common/controls:control_loop_test',
+    '//aos:queues',
+    '//aos/controls:control_loop_test',
     '//frc971/control_loops:state_feedback_loop',
     '//frc971/control_loops:team_number_test_environment',
   ],
diff --git a/y2016/control_loops/shooter/shooter.cc b/y2016/control_loops/shooter/shooter.cc
index 7b64f99..a047f55 100644
--- a/y2016/control_loops/shooter/shooter.cc
+++ b/y2016/control_loops/shooter/shooter.cc
@@ -2,9 +2,9 @@
 
 #include <chrono>
 
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
 
 #include "y2016/control_loops/shooter/shooter_plant.h"
 
diff --git a/y2016/control_loops/shooter/shooter.h b/y2016/control_loops/shooter/shooter.h
index aafc472..ac5b2d7 100644
--- a/y2016/control_loops/shooter/shooter.h
+++ b/y2016/control_loops/shooter/shooter.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/time.h"
+#include "aos/controls/control_loop.h"
+#include "aos/time/time.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 
 #include "y2016/control_loops/shooter/shooter_integral_plant.h"
diff --git a/y2016/control_loops/shooter/shooter.q b/y2016/control_loops/shooter/shooter.q
index 0e00a02..f6f9298 100644
--- a/y2016/control_loops/shooter/shooter.q
+++ b/y2016/control_loops/shooter/shooter.q
@@ -1,6 +1,6 @@
 package y2016.control_loops.shooter;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/control_loops.q";
 
 struct ShooterSideStatus {
diff --git a/y2016/control_loops/shooter/shooter_lib_test.cc b/y2016/control_loops/shooter/shooter_lib_test.cc
index 5cd7ce5..c5d5aa7 100644
--- a/y2016/control_loops/shooter/shooter_lib_test.cc
+++ b/y2016/control_loops/shooter/shooter_lib_test.cc
@@ -6,8 +6,8 @@
 #include <memory>
 
 #include "gtest/gtest.h"
-#include "aos/common/queue.h"
-#include "aos/common/controls/control_loop_test.h"
+#include "aos/queue.h"
+#include "aos/controls/control_loop_test.h"
 #include "frc971/control_loops/team_number_test_environment.h"
 #include "y2016/control_loops/shooter/shooter.q.h"
 #include "y2016/control_loops/shooter/shooter.h"
diff --git a/y2016/control_loops/superstructure/BUILD b/y2016/control_loops/superstructure/BUILD
index fb0750b..38f20d2 100644
--- a/y2016/control_loops/superstructure/BUILD
+++ b/y2016/control_loops/superstructure/BUILD
@@ -8,7 +8,7 @@
     'superstructure.q',
   ],
   deps = [
-    '//aos/common/controls:control_loop_queues',
+    '//aos/controls:control_loop_queues',
     '//frc971/control_loops:queues',
   ],
 )
@@ -75,9 +75,9 @@
   deps = [
     ':superstructure_queue',
     ':superstructure_plants',
-    '//aos/common/controls:control_loop',
-    '//aos/common/util:trapezoid_profile',
-    '//aos/common:math',
+    '//aos/controls:control_loop',
+    '//aos/util:trapezoid_profile',
+    '//aos:math',
     '//frc971/control_loops:profiled_subsystem',
     '//frc971/control_loops:simple_capped_state_feedback_loop',
     '//frc971/control_loops:state_feedback_loop',
@@ -96,10 +96,10 @@
     ':superstructure_queue',
     ':superstructure_lib',
     '//aos/testing:googletest',
-    '//aos/common:queues',
-    '//aos/common/controls:control_loop_test',
-    '//aos/common:math',
-    '//aos/common:time',
+    '//aos:queues',
+    '//aos/controls:control_loop_test',
+    '//aos:math',
+    '//aos/time:time',
     '//frc971/control_loops:position_sensor_sim',
     '//frc971/control_loops:team_number_test_environment',
   ],
diff --git a/y2016/control_loops/superstructure/superstructure.cc b/y2016/control_loops/superstructure/superstructure.cc
index 2366fb7..1bcac52 100644
--- a/y2016/control_loops/superstructure/superstructure.cc
+++ b/y2016/control_loops/superstructure/superstructure.cc
@@ -1,9 +1,9 @@
 #include "y2016/control_loops/superstructure/superstructure.h"
 #include "y2016/control_loops/superstructure/superstructure_controls.h"
 
-#include "aos/common/commonmath.h"
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
+#include "aos/commonmath.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
 
 #include "y2016/control_loops/superstructure/integral_intake_plant.h"
 #include "y2016/control_loops/superstructure/integral_arm_plant.h"
diff --git a/y2016/control_loops/superstructure/superstructure.h b/y2016/control_loops/superstructure/superstructure.h
index eb16405..17a1547 100644
--- a/y2016/control_loops/superstructure/superstructure.h
+++ b/y2016/control_loops/superstructure/superstructure.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/util/trapezoid_profile.h"
+#include "aos/controls/control_loop.h"
+#include "aos/util/trapezoid_profile.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 
 #include "frc971/zeroing/zeroing.h"
diff --git a/y2016/control_loops/superstructure/superstructure.q b/y2016/control_loops/superstructure/superstructure.q
index 76c9850..1431d23 100644
--- a/y2016/control_loops/superstructure/superstructure.q
+++ b/y2016/control_loops/superstructure/superstructure.q
@@ -1,6 +1,6 @@
 package y2016.control_loops;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/control_loops.q";
 
 struct JointState {
diff --git a/y2016/control_loops/superstructure/superstructure_controls.cc b/y2016/control_loops/superstructure/superstructure_controls.cc
index a522e40..e787f79 100644
--- a/y2016/control_loops/superstructure/superstructure_controls.cc
+++ b/y2016/control_loops/superstructure/superstructure_controls.cc
@@ -1,7 +1,7 @@
 #include "y2016/control_loops/superstructure/superstructure_controls.h"
 
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
 
 #include "y2016/control_loops/superstructure/integral_intake_plant.h"
 #include "y2016/control_loops/superstructure/integral_arm_plant.h"
diff --git a/y2016/control_loops/superstructure/superstructure_controls.h b/y2016/control_loops/superstructure/superstructure_controls.h
index 5d8c85a..49c8097 100644
--- a/y2016/control_loops/superstructure/superstructure_controls.h
+++ b/y2016/control_loops/superstructure/superstructure_controls.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/util/trapezoid_profile.h"
+#include "aos/controls/control_loop.h"
+#include "aos/util/trapezoid_profile.h"
 #include "frc971/control_loops/profiled_subsystem.h"
 #include "frc971/control_loops/simple_capped_state_feedback_loop.h"
 #include "frc971/control_loops/state_feedback_loop.h"
diff --git a/y2016/control_loops/superstructure/superstructure_lib_test.cc b/y2016/control_loops/superstructure/superstructure_lib_test.cc
index b3e980d..824f291 100644
--- a/y2016/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2016/control_loops/superstructure/superstructure_lib_test.cc
@@ -5,10 +5,10 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/commonmath.h"
-#include "aos/common/controls/control_loop_test.h"
-#include "aos/common/queue.h"
-#include "aos/common/time.h"
+#include "aos/commonmath.h"
+#include "aos/controls/control_loop_test.h"
+#include "aos/queue.h"
+#include "aos/time/time.h"
 #include "frc971/control_loops/position_sensor_sim.h"
 #include "frc971/control_loops/team_number_test_environment.h"
 #include "gtest/gtest.h"
diff --git a/y2016/dashboard/BUILD b/y2016/dashboard/BUILD
index a926350..aa26aef 100644
--- a/y2016/dashboard/BUILD
+++ b/y2016/dashboard/BUILD
@@ -25,9 +25,9 @@
   deps = [
     ':gen_embedded',
     '//aos/linux_code:init',
-    '//aos/common/logging',
-    '//aos/common/util:phased_loop',
-    '//aos/common:time',
+    '//aos/logging',
+    '//aos/util:phased_loop',
+    '//aos/time:time',
     '//frc971/autonomous:auto_queue',
     '//third_party/seasocks',
     '//y2016/vision:vision_queue',
diff --git a/y2016/dashboard/dashboard.cc b/y2016/dashboard/dashboard.cc
index 4b4c0e9..5882eea 100644
--- a/y2016/dashboard/dashboard.cc
+++ b/y2016/dashboard/dashboard.cc
@@ -11,10 +11,10 @@
 #include "seasocks/Server.h"
 
 #include "aos/linux_code/init.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/time.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/mutex.h"
+#include "aos/logging/logging.h"
+#include "aos/time/time.h"
+#include "aos/util/phased_loop.h"
+#include "aos/mutex/mutex.h"
 
 #include "frc971/autonomous/auto.q.h"
 
diff --git a/y2016/dashboard/dashboard.h b/y2016/dashboard/dashboard.h
index e093cb9..a95c476 100644
--- a/y2016/dashboard/dashboard.h
+++ b/y2016/dashboard/dashboard.h
@@ -12,9 +12,9 @@
 #include "seasocks/WebSocket.h"
 
 #include "aos/linux_code/init.h"
-#include "aos/common/time.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/mutex.h"
+#include "aos/time/time.h"
+#include "aos/util/phased_loop.h"
+#include "aos/mutex/mutex.h"
 
 namespace y2016 {
 namespace dashboard {
diff --git a/y2016/joystick_reader.cc b/y2016/joystick_reader.cc
index 7b48512..bc90a51 100644
--- a/y2016/joystick_reader.cc
+++ b/y2016/joystick_reader.cc
@@ -5,11 +5,11 @@
 
 #include "aos/linux_code/init.h"
 #include "aos/input/joystick_input.h"
-#include "aos/common/input/driver_station_data.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/time.h"
-#include "aos/common/actions/actions.h"
+#include "aos/input/driver_station_data.h"
+#include "aos/logging/logging.h"
+#include "aos/util/log_interval.h"
+#include "aos/time/time.h"
+#include "aos/actions/actions.h"
 
 #include "frc971/autonomous/auto.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
diff --git a/y2016/vision/BUILD b/y2016/vision/BUILD
index 1220946..da3c7b2 100644
--- a/y2016/vision/BUILD
+++ b/y2016/vision/BUILD
@@ -87,7 +87,7 @@
     ],
     deps = [
         ":calibration",
-        "//aos/common/logging",
+        "//aos/logging",
         "//aos/vision/math:vector",
     ],
 )
@@ -103,9 +103,9 @@
         ":calibration",
         ":stereo_geometry",
         ":vision_data",
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/logging:implementations",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/logging:implementations",
         "//aos/vision/events:epoll_events",
         "//aos/vision/events:socket_types",
         "//aos/vision/events:udp",
@@ -149,10 +149,10 @@
         ":stereo_geometry",
         ":vision_data",
         ":vision_queue",
-        "//aos/common:mutex",
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
+        "//aos/mutex:mutex",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
         "//aos/linux_code:init",
         "//aos/vision/events:udp",
         "//frc971/control_loops/drivetrain:drivetrain_queue",
diff --git a/y2016/vision/stereo_geometry.h b/y2016/vision/stereo_geometry.h
index a758f1c..f1ffe51 100644
--- a/y2016/vision/stereo_geometry.h
+++ b/y2016/vision/stereo_geometry.h
@@ -3,7 +3,7 @@
 
 #include <string>
 
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "aos/vision/math/vector.h"
 
 #include "y2016/vision/calibration.pb.h"
diff --git a/y2016/vision/target_receiver.cc b/y2016/vision/target_receiver.cc
index 3e4465d..3f2fbbc 100644
--- a/y2016/vision/target_receiver.cc
+++ b/y2016/vision/target_receiver.cc
@@ -10,10 +10,10 @@
 #include <thread>
 #include <vector>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/mutex.h"
-#include "aos/common/time.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/mutex/mutex.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
 #include "aos/vision/events/udp.h"
 
diff --git a/y2016/vision/target_sender.cc b/y2016/vision/target_sender.cc
index 85e62c4..d9208ec 100644
--- a/y2016/vision/target_sender.cc
+++ b/y2016/vision/target_sender.cc
@@ -7,9 +7,9 @@
 #include <thread>
 #include <vector>
 
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/time.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/logging.h"
+#include "aos/time/time.h"
 #include "aos/vision/events/socket_types.h"
 #include "aos/vision/events/udp.h"
 #include "aos/vision/image/image_stream.h"
diff --git a/y2016/wpilib_interface.cc b/y2016/wpilib_interface.cc
index 2f37bcb..4e95934 100644
--- a/y2016/wpilib_interface.cc
+++ b/y2016/wpilib_interface.cc
@@ -21,16 +21,16 @@
 #endif
 #undef ERROR
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/time.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/util/wrapping_counter.h"
-#include "aos/common/stl_mutex.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/time/time.h"
+#include "aos/util/log_interval.h"
+#include "aos/util/phased_loop.h"
+#include "aos/util/wrapping_counter.h"
+#include "aos/stl_mutex/stl_mutex.h"
 #include "aos/linux_code/init.h"
-#include "aos/common/messages/robot_state.q.h"
-#include "aos/common/commonmath.h"
+#include "aos/robot_state/robot_state.q.h"
+#include "aos/commonmath.h"
 
 #include "frc971/autonomous/auto.q.h"
 #include "frc971/control_loops/control_loops.q.h"
diff --git a/y2017/BUILD b/y2017/BUILD
index f294aaa..25777a4 100644
--- a/y2017/BUILD
+++ b/y2017/BUILD
@@ -11,9 +11,9 @@
     visibility = ["//visibility:public"],
     deps = [
         "//aos:once",
-        "//aos/common:mutex",
-        "//aos/common/logging",
-        "//aos/common/network:team_number",
+        "//aos/mutex:mutex",
+        "//aos/logging",
+        "//aos/network:team_number",
         "//frc971:constants",
         "//frc971/shooter_interpolation:interpolation",
         "//y2017/control_loops/drivetrain:polydrivetrain_plants",
@@ -31,10 +31,10 @@
     ],
     deps = [
         ":constants",
-        "//aos/common:time",
-        "//aos/common/actions:action_lib",
-        "//aos/common/logging",
-        "//aos/common/util:log_interval",
+        "//aos/time:time",
+        "//aos/actions:action_lib",
+        "//aos/logging",
+        "//aos/util:log_interval",
         "//aos/input:drivetrain_input",
         "//aos/input:joystick_input",
         "//aos/linux_code:init",
@@ -54,16 +54,16 @@
     restricted_to = ["//tools:roborio"],
     deps = [
         ":constants",
-        "//aos/common:math",
-        "//aos/common:stl_mutex",
-        "//aos/common:time",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
-        "//aos/common/util:phased_loop",
-        "//aos/common/util:wrapping_counter",
+        "//aos:math",
+        "//aos/stl_mutex:stl_mutex",
+        "//aos/time:time",
+        "//aos/controls:control_loop",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
+        "//aos/util:phased_loop",
+        "//aos/util:wrapping_counter",
         "//aos/linux_code:init",
         "//frc971/autonomous:auto_queue",
         "//frc971/control_loops:queues",
diff --git a/y2017/actors/BUILD b/y2017/actors/BUILD
index 95dc87a..3f37300 100644
--- a/y2017/actors/BUILD
+++ b/y2017/actors/BUILD
@@ -18,9 +18,9 @@
     'autonomous_actor.h',
   ],
   deps = [
-    '//aos/common/util:phased_loop',
-    '//aos/common/logging',
-    '//aos/common/actions:action_lib',
+    '//aos/util:phased_loop',
+    '//aos/logging',
+    '//aos/actions:action_lib',
     '//frc971/autonomous:base_autonomous_actor',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
     '//frc971/control_loops/drivetrain:drivetrain_config',
diff --git a/y2017/actors/autonomous_actor.cc b/y2017/actors/autonomous_actor.cc
index c5114a3..c123612 100644
--- a/y2017/actors/autonomous_actor.cc
+++ b/y2017/actors/autonomous_actor.cc
@@ -5,8 +5,8 @@
 #include <chrono>
 #include <cmath>
 
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/logging/logging.h"
+#include "aos/util/phased_loop.h"
+#include "aos/logging/logging.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2017/control_loops/drivetrain/drivetrain_base.h"
diff --git a/y2017/actors/autonomous_actor.h b/y2017/actors/autonomous_actor.h
index d099725..a27c27e 100644
--- a/y2017/actors/autonomous_actor.h
+++ b/y2017/actors/autonomous_actor.h
@@ -4,8 +4,8 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/actions/actions.h"
-#include "aos/common/actions/actor.h"
+#include "aos/actions/actions.h"
+#include "aos/actions/actor.h"
 #include "frc971/autonomous/base_autonomous_actor.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain_config.h"
diff --git a/y2017/constants.cc b/y2017/constants.cc
index 9530e27..6f77838 100644
--- a/y2017/constants.cc
+++ b/y2017/constants.cc
@@ -10,9 +10,9 @@
 #include "sanitizer/lsan_interface.h"
 #endif
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/mutex.h"
-#include "aos/common/network/team_number.h"
+#include "aos/logging/logging.h"
+#include "aos/mutex/mutex.h"
+#include "aos/network/team_number.h"
 #include "aos/once.h"
 
 #include "y2017/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
diff --git a/y2017/control_loops/python/BUILD b/y2017/control_loops/python/BUILD
index 47c24e8..5d7a002 100644
--- a/y2017/control_loops/python/BUILD
+++ b/y2017/control_loops/python/BUILD
@@ -86,7 +86,7 @@
     restricted_to = ["//tools:k8"],
     deps = [
         ":python_init",
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
@@ -103,7 +103,7 @@
     restricted_to = ["//tools:k8"],
     deps = [
         ":python_init",
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
@@ -120,7 +120,7 @@
     restricted_to = ["//tools:k8"],
     deps = [
         ":python_init",
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
@@ -135,7 +135,7 @@
     ],
     restricted_to = ["//tools:k8"],
     deps = [
-        "//aos/common/util:py_trapezoid_profile",
+        "//aos/util:py_trapezoid_profile",
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
diff --git a/y2017/control_loops/python/column.py b/y2017/control_loops/python/column.py
index 4cbf4dd..1f8bd76 100755
--- a/y2017/control_loops/python/column.py
+++ b/y2017/control_loops/python/column.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-from aos.common.util.trapezoid_profile import TrapezoidProfile
+from aos.util.trapezoid_profile import TrapezoidProfile
 from frc971.control_loops.python import control_loop
 from frc971.control_loops.python import controls
 from y2017.control_loops.python import turret
diff --git a/y2017/control_loops/python/hood.py b/y2017/control_loops/python/hood.py
index 2704216..fb5aa4e 100755
--- a/y2017/control_loops/python/hood.py
+++ b/y2017/control_loops/python/hood.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-from aos.common.util.trapezoid_profile import TrapezoidProfile
+from aos.util.trapezoid_profile import TrapezoidProfile
 from frc971.control_loops.python import control_loop
 from frc971.control_loops.python import controls
 import numpy
diff --git a/y2017/control_loops/python/intake.py b/y2017/control_loops/python/intake.py
index 5f557f1..64998c7 100755
--- a/y2017/control_loops/python/intake.py
+++ b/y2017/control_loops/python/intake.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-from aos.common.util.trapezoid_profile import TrapezoidProfile
+from aos.util.trapezoid_profile import TrapezoidProfile
 from frc971.control_loops.python import control_loop
 from frc971.control_loops.python import controls
 import numpy
diff --git a/y2017/control_loops/python/turret.py b/y2017/control_loops/python/turret.py
index f07e7a5..e8829eb 100755
--- a/y2017/control_loops/python/turret.py
+++ b/y2017/control_loops/python/turret.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-from aos.common.util.trapezoid_profile import TrapezoidProfile
+from aos.util.trapezoid_profile import TrapezoidProfile
 from frc971.control_loops.python import control_loop
 from frc971.control_loops.python import controls
 import numpy
diff --git a/y2017/control_loops/superstructure/BUILD b/y2017/control_loops/superstructure/BUILD
index 37136c8..e7836b3 100644
--- a/y2017/control_loops/superstructure/BUILD
+++ b/y2017/control_loops/superstructure/BUILD
@@ -8,7 +8,7 @@
     'superstructure.q',
   ],
   deps = [
-    '//aos/common/controls:control_loop_queues',
+    '//aos/controls:control_loop_queues',
     '//frc971/control_loops:profiled_subsystem_queue',
     '//frc971/control_loops:queues',
   ],
@@ -25,7 +25,7 @@
   deps = [
     ':vision_distance_average',
     ':superstructure_queue',
-    '//aos/common/controls:control_loop',
+    '//aos/controls:control_loop',
     '//y2017/control_loops/superstructure/column',
     '//y2017/control_loops/superstructure/hood',
     '//y2017/control_loops/superstructure/intake',
@@ -42,10 +42,10 @@
   deps = [
     ':superstructure_queue',
     ':superstructure_lib',
-    '//aos/common/controls:control_loop_test',
-    '//aos/common:math',
-    '//aos/common:queues',
-    '//aos/common:time',
+    '//aos/controls:control_loop_test',
+    '//aos:math',
+    '//aos:queues',
+    '//aos/time:time',
     '//aos/testing:googletest',
     '//frc971/control_loops:position_sensor_sim',
     '//frc971/control_loops:team_number_test_environment',
@@ -78,7 +78,7 @@
   ],
   deps = [
     ':superstructure_queue',
-    '//aos/common:ring_buffer',
+    '//aos/ring_buffer:ring_buffer',
     '//frc971/control_loops/drivetrain:drivetrain_queue',
     '//y2017/control_loops/drivetrain:polydrivetrain_plants',
     '//y2017/vision:vision_queue',
@@ -92,7 +92,7 @@
   ],
   deps = [
     ':vision_time_adjuster',
-    '//aos/common:time',
+    '//aos/time:time',
     '//aos/testing:googletest',
     '//aos/testing:test_shm',
   ],
@@ -104,8 +104,8 @@
     'vision_distance_average.h',
   ],
   deps = [
-    '//aos/common:time',
-    '//aos/common:ring_buffer',
+    '//aos/time:time',
+    '//aos/ring_buffer:ring_buffer',
     '//y2017/vision:vision_queue',
   ],
 )
@@ -117,7 +117,7 @@
   ],
   deps = [
     ':vision_distance_average',
-    '//aos/common:time',
+    '//aos/time:time',
     '//aos/testing:googletest',
   ],
 )
diff --git a/y2017/control_loops/superstructure/column/BUILD b/y2017/control_loops/superstructure/column/BUILD
index 149ef32..694dd47 100644
--- a/y2017/control_loops/superstructure/column/BUILD
+++ b/y2017/control_loops/superstructure/column/BUILD
@@ -44,8 +44,8 @@
   deps = [
     ':column_plants',
     ':column_zeroing',
-    '//aos/common/controls:control_loop',
-    '//aos/common:math',
+    '//aos/controls:control_loop',
+    '//aos:math',
     '//frc971/control_loops:profiled_subsystem',
     '//y2017/control_loops/superstructure/intake:intake',
     '//y2017/control_loops/superstructure:superstructure_queue',
diff --git a/y2017/control_loops/superstructure/column/column.cc b/y2017/control_loops/superstructure/column/column.cc
index 346a5d5..aaca601 100644
--- a/y2017/control_loops/superstructure/column/column.cc
+++ b/y2017/control_loops/superstructure/column/column.cc
@@ -7,7 +7,7 @@
 
 #include "Eigen/Dense"
 
-#include "aos/common/commonmath.h"
+#include "aos/commonmath.h"
 #include "frc971/constants.h"
 #include "frc971/control_loops/profiled_subsystem.h"
 #include "frc971/control_loops/state_feedback_loop.h"
diff --git a/y2017/control_loops/superstructure/column/column_zeroing_test.cc b/y2017/control_loops/superstructure/column/column_zeroing_test.cc
index e6739fc..3cc9c2e 100644
--- a/y2017/control_loops/superstructure/column/column_zeroing_test.cc
+++ b/y2017/control_loops/superstructure/column/column_zeroing_test.cc
@@ -2,7 +2,7 @@
 #include <memory>
 #include <random>
 
-#include "aos/common/die.h"
+#include "aos/die.h"
 #include "aos/testing/test_shm.h"
 #include "frc971/control_loops/position_sensor_sim.h"
 #include "frc971/control_loops/team_number_test_environment.h"
diff --git a/y2017/control_loops/superstructure/shooter/BUILD b/y2017/control_loops/superstructure/shooter/BUILD
index 3f9b17e..cb7fa54 100644
--- a/y2017/control_loops/superstructure/shooter/BUILD
+++ b/y2017/control_loops/superstructure/shooter/BUILD
@@ -42,7 +42,7 @@
   ],
   deps = [
     ':shooter_plants',
-    '//aos/common/controls:control_loop',
+    '//aos/controls:control_loop',
     '//third_party/eigen',
     '//y2017/control_loops/superstructure:superstructure_queue',
   ],
diff --git a/y2017/control_loops/superstructure/shooter/shooter.cc b/y2017/control_loops/superstructure/shooter/shooter.cc
index f8bfecf..fee9124 100644
--- a/y2017/control_loops/superstructure/shooter/shooter.cc
+++ b/y2017/control_loops/superstructure/shooter/shooter.cc
@@ -2,9 +2,9 @@
 
 #include <chrono>
 
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
 
 #include "y2017/control_loops/superstructure/shooter/shooter.h"
 
diff --git a/y2017/control_loops/superstructure/shooter/shooter.h b/y2017/control_loops/superstructure/shooter/shooter.h
index 3a9f3f9..e8f7789 100644
--- a/y2017/control_loops/superstructure/shooter/shooter.h
+++ b/y2017/control_loops/superstructure/shooter/shooter.h
@@ -4,8 +4,8 @@
 #include <array>
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/time.h"
+#include "aos/controls/control_loop.h"
+#include "aos/time/time.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 #include "third_party/eigen/Eigen/Dense"
 
diff --git a/y2017/control_loops/superstructure/superstructure.cc b/y2017/control_loops/superstructure/superstructure.cc
index 18f9606..054fab4 100644
--- a/y2017/control_loops/superstructure/superstructure.cc
+++ b/y2017/control_loops/superstructure/superstructure.cc
@@ -1,7 +1,7 @@
 #include "y2017/control_loops/superstructure/superstructure.h"
 
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2017/constants.h"
 #include "y2017/control_loops/superstructure/column/column.h"
diff --git a/y2017/control_loops/superstructure/superstructure.h b/y2017/control_loops/superstructure/superstructure.h
index 263d4b0..399e166 100644
--- a/y2017/control_loops/superstructure/superstructure.h
+++ b/y2017/control_loops/superstructure/superstructure.h
@@ -3,7 +3,7 @@
 
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
+#include "aos/controls/control_loop.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 #include "y2017/control_loops/superstructure/column/column.h"
 #include "y2017/control_loops/superstructure/hood/hood.h"
diff --git a/y2017/control_loops/superstructure/superstructure.q b/y2017/control_loops/superstructure/superstructure.q
index bac9051..60c5e16 100644
--- a/y2017/control_loops/superstructure/superstructure.q
+++ b/y2017/control_loops/superstructure/superstructure.q
@@ -1,6 +1,6 @@
 package y2017.control_loops;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/profiled_subsystem.q";
 // TODO(austin): Add this back in when the queue compiler supports diamond
 // inheritance.
diff --git a/y2017/control_loops/superstructure/superstructure_lib_test.cc b/y2017/control_loops/superstructure/superstructure_lib_test.cc
index e4e391c..d538dc8 100644
--- a/y2017/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2017/control_loops/superstructure/superstructure_lib_test.cc
@@ -5,8 +5,8 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/controls/control_loop_test.h"
-#include "aos/common/queue.h"
+#include "aos/controls/control_loop_test.h"
+#include "aos/queue.h"
 #include "frc971/control_loops/position_sensor_sim.h"
 #include "frc971/control_loops/team_number_test_environment.h"
 #include "gtest/gtest.h"
diff --git a/y2017/control_loops/superstructure/vision_distance_average.h b/y2017/control_loops/superstructure/vision_distance_average.h
index ed0664e..22464b7 100644
--- a/y2017/control_loops/superstructure/vision_distance_average.h
+++ b/y2017/control_loops/superstructure/vision_distance_average.h
@@ -4,8 +4,8 @@
 #include <stdint.h>
 #include <chrono>
 
-#include "aos/common/ring_buffer.h"
-#include "aos/common/time.h"
+#include "aos/ring_buffer/ring_buffer.h"
+#include "aos/time/time.h"
 #include "y2017/vision/vision.q.h"
 
 namespace y2017 {
diff --git a/y2017/control_loops/superstructure/vision_time_adjuster.h b/y2017/control_loops/superstructure/vision_time_adjuster.h
index 46c7f89..52e7d70 100644
--- a/y2017/control_loops/superstructure/vision_time_adjuster.h
+++ b/y2017/control_loops/superstructure/vision_time_adjuster.h
@@ -3,8 +3,8 @@
 
 #include <stdint.h>
 
-#include "aos/common/ring_buffer.h"
-#include "aos/common/time.h"
+#include "aos/ring_buffer/ring_buffer.h"
+#include "aos/time/time.h"
 #include "y2017/vision/vision.q.h"
 
 namespace y2017 {
diff --git a/y2017/control_loops/superstructure/vision_time_adjuster_test.cc b/y2017/control_loops/superstructure/vision_time_adjuster_test.cc
index c6dcd25..8dc3998 100644
--- a/y2017/control_loops/superstructure/vision_time_adjuster_test.cc
+++ b/y2017/control_loops/superstructure/vision_time_adjuster_test.cc
@@ -2,7 +2,7 @@
 
 #include "gtest/gtest.h"
 
-#include "aos/common/time.h"
+#include "aos/time/time.h"
 #include "aos/testing/test_shm.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2017/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
diff --git a/y2017/joystick_reader.cc b/y2017/joystick_reader.cc
index b47c733..b9bbe3d 100644
--- a/y2017/joystick_reader.cc
+++ b/y2017/joystick_reader.cc
@@ -3,11 +3,11 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "aos/common/actions/actions.h"
-#include "aos/common/input/driver_station_data.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/time.h"
-#include "aos/common/util/log_interval.h"
+#include "aos/actions/actions.h"
+#include "aos/input/driver_station_data.h"
+#include "aos/logging/logging.h"
+#include "aos/time/time.h"
+#include "aos/util/log_interval.h"
 #include "aos/input/drivetrain_input.h"
 #include "aos/input/joystick_input.h"
 #include "aos/linux_code/init.h"
diff --git a/y2017/vision/BUILD b/y2017/vision/BUILD
index 2cb41ed..f4c4346 100644
--- a/y2017/vision/BUILD
+++ b/y2017/vision/BUILD
@@ -34,9 +34,9 @@
     ':vision_result',
     ':vision_config',
     ':target_finder',
-    '//aos/common/logging:logging',
-    '//aos/common/logging:implementations',
-    '//aos/common:time',
+    '//aos/logging:logging',
+    '//aos/logging:implementations',
+    '//aos/time:time',
     '//aos/vision/image:reader',
     '//aos/vision/image:jpeg_routines',
     '//aos/vision/image:image_stream',
@@ -57,15 +57,15 @@
   ],
   visibility = ['//visibility:public'],
   deps = [
-    '//aos/common/logging',
-    '//aos/common/logging:queue_logging',
+    '//aos/logging',
+    '//aos/logging:queue_logging',
     '//aos/linux_code:init',
-    '//aos/common:time',
+    '//aos/time:time',
     '//aos/vision/events:udp',
     ':vision_queue',
     ':vision_result',
     ':target_finder',
-    '//aos/common:mutex',
+    '//aos/mutex:mutex',
   ],
 )
 
diff --git a/y2017/vision/target_receiver.cc b/y2017/vision/target_receiver.cc
index 556ae2a..56076c7 100644
--- a/y2017/vision/target_receiver.cc
+++ b/y2017/vision/target_receiver.cc
@@ -1,8 +1,8 @@
 #include <netdb.h>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/time.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
 #include "aos/vision/events/udp.h"
 #include "y2017/vision/target_finder.h"
diff --git a/y2017/vision/target_sender.cc b/y2017/vision/target_sender.cc
index 8eb13f5..261c397 100644
--- a/y2017/vision/target_sender.cc
+++ b/y2017/vision/target_sender.cc
@@ -9,9 +9,9 @@
 #include <thread>
 #include <vector>
 
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/time.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/logging.h"
+#include "aos/time/time.h"
 #include "aos/vision/blob/codec.h"
 #include "aos/vision/blob/find_blob.h"
 #include "aos/vision/blob/range_image.h"
diff --git a/y2017/wpilib_interface.cc b/y2017/wpilib_interface.cc
index 08ce044..52a6989 100644
--- a/y2017/wpilib_interface.cc
+++ b/y2017/wpilib_interface.cc
@@ -21,16 +21,16 @@
 #include "VictorSP.h"
 #undef ERROR
 
-#include "aos/common/commonmath.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/messages/robot_state.q.h"
-#include "aos/common/stl_mutex.h"
-#include "aos/common/time.h"
-#include "aos/common/util/compiler_memory_barrier.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/util/wrapping_counter.h"
+#include "aos/commonmath.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/robot_state/robot_state.q.h"
+#include "aos/stl_mutex/stl_mutex.h"
+#include "aos/time/time.h"
+#include "aos/util/compiler_memory_barrier.h"
+#include "aos/util/log_interval.h"
+#include "aos/util/phased_loop.h"
+#include "aos/util/wrapping_counter.h"
 #include "aos/linux_code/init.h"
 
 #include "frc971/autonomous/auto.q.h"
diff --git a/y2017_bot3/BUILD b/y2017_bot3/BUILD
index f07dcf6..430255a 100644
--- a/y2017_bot3/BUILD
+++ b/y2017_bot3/BUILD
@@ -6,10 +6,10 @@
         "joystick_reader.cc",
     ],
     deps = [
-        "//aos/common:time",
-        "//aos/common/actions:action_lib",
-        "//aos/common/logging",
-        "//aos/common/util:log_interval",
+        "//aos/time:time",
+        "//aos/actions:action_lib",
+        "//aos/logging",
+        "//aos/util:log_interval",
         "//aos/input:drivetrain_input",
         "//aos/input:joystick_input",
         "//aos/linux_code:init",
@@ -29,15 +29,15 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        "//aos/common:math",
-        "//aos/common:stl_mutex",
-        "//aos/common:time",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
-        "//aos/common/util:phased_loop",
+        "//aos:math",
+        "//aos/stl_mutex:stl_mutex",
+        "//aos/time:time",
+        "//aos/controls:control_loop",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
+        "//aos/util:phased_loop",
         "//aos/linux_code:init",
         "//frc971/control_loops:queues",
         "//frc971/control_loops/drivetrain:drivetrain_queue",
diff --git a/y2017_bot3/control_loops/superstructure/BUILD b/y2017_bot3/control_loops/superstructure/BUILD
index 8f8de13..5679e1b 100644
--- a/y2017_bot3/control_loops/superstructure/BUILD
+++ b/y2017_bot3/control_loops/superstructure/BUILD
@@ -8,7 +8,7 @@
     'superstructure.q',
   ],
   deps = [
-    '//aos/common/controls:control_loop_queues',
+    '//aos/controls:control_loop_queues',
     '//frc971/control_loops:profiled_subsystem_queue',
     '//frc971/control_loops:queues',
   ],
@@ -24,9 +24,9 @@
   ],
   deps = [
     ':superstructure_queue',
-    '//aos/common/controls:control_loop',
-    '//aos/common/util:trapezoid_profile',
-    '//aos/common:math',
+    '//aos/controls:control_loop',
+    '//aos/util:trapezoid_profile',
+    '//aos:math',
     '//frc971/control_loops:profiled_subsystem',
     '//frc971/control_loops:simple_capped_state_feedback_loop',
     '//frc971/control_loops:state_feedback_loop',
diff --git a/y2017_bot3/control_loops/superstructure/superstructure.cc b/y2017_bot3/control_loops/superstructure/superstructure.cc
index 65dc0da..1b91c69 100644
--- a/y2017_bot3/control_loops/superstructure/superstructure.cc
+++ b/y2017_bot3/control_loops/superstructure/superstructure.cc
@@ -1,8 +1,8 @@
 #include "y2017_bot3/control_loops/superstructure/superstructure.h"
 
-#include "aos/common/commonmath.h"
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
+#include "aos/commonmath.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
 
 namespace y2017_bot3 {
 namespace control_loops {
diff --git a/y2017_bot3/control_loops/superstructure/superstructure.h b/y2017_bot3/control_loops/superstructure/superstructure.h
index 79a901b..99a75e3 100644
--- a/y2017_bot3/control_loops/superstructure/superstructure.h
+++ b/y2017_bot3/control_loops/superstructure/superstructure.h
@@ -3,8 +3,8 @@
 
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
-#include "aos/common/util/trapezoid_profile.h"
+#include "aos/controls/control_loop.h"
+#include "aos/util/trapezoid_profile.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 #include "frc971/zeroing/zeroing.h"
 #include "y2017_bot3/control_loops/superstructure/superstructure.q.h"
diff --git a/y2017_bot3/control_loops/superstructure/superstructure.q b/y2017_bot3/control_loops/superstructure/superstructure.q
index 05249d2..10a0fca 100644
--- a/y2017_bot3/control_loops/superstructure/superstructure.q
+++ b/y2017_bot3/control_loops/superstructure/superstructure.q
@@ -1,6 +1,6 @@
 package y2017_bot3.control_loops;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/control_loops.q";
 
 queue_group SuperstructureQueue {
diff --git a/y2017_bot3/joystick_reader.cc b/y2017_bot3/joystick_reader.cc
index ff3961c..713247f 100644
--- a/y2017_bot3/joystick_reader.cc
+++ b/y2017_bot3/joystick_reader.cc
@@ -3,11 +3,11 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "aos/common/actions/actions.h"
-#include "aos/common/input/driver_station_data.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/util/log_interval.h"
+#include "aos/actions/actions.h"
+#include "aos/input/driver_station_data.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/logging.h"
+#include "aos/util/log_interval.h"
 #include "aos/input/drivetrain_input.h"
 #include "aos/input/joystick_input.h"
 #include "aos/linux_code/init.h"
diff --git a/y2017_bot3/wpilib_interface.cc b/y2017_bot3/wpilib_interface.cc
index c337035..4022670 100644
--- a/y2017_bot3/wpilib_interface.cc
+++ b/y2017_bot3/wpilib_interface.cc
@@ -18,15 +18,15 @@
 #include "VictorSP.h"
 #undef ERROR
 
-#include "aos/common/commonmath.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/messages/robot_state.q.h"
-#include "aos/common/stl_mutex.h"
-#include "aos/common/time.h"
-#include "aos/common/util/compiler_memory_barrier.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/util/phased_loop.h"
+#include "aos/commonmath.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/robot_state/robot_state.q.h"
+#include "aos/stl_mutex/stl_mutex.h"
+#include "aos/time/time.h"
+#include "aos/util/compiler_memory_barrier.h"
+#include "aos/util/log_interval.h"
+#include "aos/util/phased_loop.h"
 #include "aos/linux_code/init.h"
 
 #include "frc971/control_loops/control_loops.q.h"
diff --git a/y2018/BUILD b/y2018/BUILD
index cccc2cf..51bffd2 100644
--- a/y2018/BUILD
+++ b/y2018/BUILD
@@ -43,12 +43,12 @@
     ],
     deps = [
         ":vision_proto",
-        "//aos/common:stl_mutex",
-        "//aos/common:time",
-        "//aos/common/actions:action_lib",
-        "//aos/common/logging",
-        "//aos/common/network:team_number",
-        "//aos/common/util:log_interval",
+        "//aos/stl_mutex:stl_mutex",
+        "//aos/time:time",
+        "//aos/actions:action_lib",
+        "//aos/logging",
+        "//aos/network:team_number",
+        "//aos/util:log_interval",
         "//aos/input:drivetrain_input",
         "//aos/input:joystick_input",
         "//aos/linux_code:init",
@@ -73,9 +73,9 @@
     visibility = ["//visibility:public"],
     deps = [
         "//aos:once",
-        "//aos/common:mutex",
-        "//aos/common/logging",
-        "//aos/common/network:team_number",
+        "//aos/mutex:mutex",
+        "//aos/logging",
+        "//aos/network:team_number",
         "//frc971:constants",
         "//frc971/shooter_interpolation:interpolation",
         "//y2018/control_loops/drivetrain:polydrivetrain_plants",
@@ -92,16 +92,16 @@
     restricted_to = ["//tools:roborio"],
     deps = [
         ":status_light",
-        "//aos/common:math",
-        "//aos/common:stl_mutex",
-        "//aos/common:time",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
-        "//aos/common/messages:robot_state",
-        "//aos/common/util:log_interval",
-        "//aos/common/util:phased_loop",
-        "//aos/common/util:wrapping_counter",
+        "//aos:math",
+        "//aos/stl_mutex:stl_mutex",
+        "//aos/time:time",
+        "//aos/controls:control_loop",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
+        "//aos/robot_state:robot_state",
+        "//aos/util:log_interval",
+        "//aos/util:phased_loop",
+        "//aos/util:wrapping_counter",
         "//aos/linux_code:init",
         "//frc971/autonomous:auto_queue",
         "//frc971/control_loops:queues",
diff --git a/y2018/actors/BUILD b/y2018/actors/BUILD
index fa772b8..876d8e4 100644
--- a/y2018/actors/BUILD
+++ b/y2018/actors/BUILD
@@ -9,9 +9,9 @@
         "autonomous_actor.h",
     ],
     deps = [
-        "//aos/common/actions:action_lib",
-        "//aos/common/logging",
-        "//aos/common/util:phased_loop",
+        "//aos/actions:action_lib",
+        "//aos/logging",
+        "//aos/util:phased_loop",
         "//frc971/autonomous:base_autonomous_actor",
         "//frc971/control_loops/drivetrain:drivetrain_config",
         "//frc971/control_loops/drivetrain:drivetrain_queue",
diff --git a/y2018/actors/autonomous_actor.cc b/y2018/actors/autonomous_actor.cc
index cb1dd9c..783a166 100644
--- a/y2018/actors/autonomous_actor.cc
+++ b/y2018/actors/autonomous_actor.cc
@@ -5,8 +5,8 @@
 #include <chrono>
 #include <cmath>
 
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/logging/logging.h"
+#include "aos/util/phased_loop.h"
+#include "aos/logging/logging.h"
 
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2018/control_loops/drivetrain/drivetrain_base.h"
diff --git a/y2018/actors/autonomous_actor.h b/y2018/actors/autonomous_actor.h
index 32f8287..0cff3f3 100644
--- a/y2018/actors/autonomous_actor.h
+++ b/y2018/actors/autonomous_actor.h
@@ -4,8 +4,8 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/actions/actions.h"
-#include "aos/common/actions/actor.h"
+#include "aos/actions/actions.h"
+#include "aos/actions/actor.h"
 #include "frc971/autonomous/base_autonomous_actor.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain_config.h"
diff --git a/y2018/constants.cc b/y2018/constants.cc
index 70c58f0..408a058 100644
--- a/y2018/constants.cc
+++ b/y2018/constants.cc
@@ -10,9 +10,9 @@
 #include "sanitizer/lsan_interface.h"
 #endif
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/mutex.h"
-#include "aos/common/network/team_number.h"
+#include "aos/logging/logging.h"
+#include "aos/mutex/mutex.h"
+#include "aos/network/team_number.h"
 #include "aos/once.h"
 
 #include "y2018/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
diff --git a/y2018/control_loops/python/BUILD b/y2018/control_loops/python/BUILD
index 3982722..925e7b6 100644
--- a/y2018/control_loops/python/BUILD
+++ b/y2018/control_loops/python/BUILD
@@ -96,13 +96,13 @@
 )
 
 cc_library(
-  name = 'dlqr',
-  hdrs = [
-    'dlqr.h',
-  ],
+    name = "dlqr",
+    hdrs = [
+        "dlqr.h",
+    ],
     deps = [
-        '@slycot_repo//:slicot',
-  ],
+        "@slycot_repo//:slicot",
+    ],
 )
 
 cc_binary(
@@ -110,15 +110,15 @@
     srcs = [
         "arm_mpc.cc",
     ],
+    restricted_to = ["//tools:k8"],
     deps = [
         ":arm_bounds",
-        ':dlqr',
+        ":dlqr",
         "//third_party/ct",
         "//third_party/gflags",
         "//third_party/matplotlib-cpp",
         "@cgal_repo//:cgal",
     ],
-    restricted_to = ["//tools:k8"],
 )
 
 cc_binary(
@@ -169,9 +169,11 @@
     ],
     default_python_version = "PY3",
     legacy_create_init = False,
+    restricted_to = ["//tools:k8"],
     srcs_version = "PY3",
     deps = [
         ":python_init",
+        "@python_gtk",
     ],
 )
 
@@ -210,15 +212,15 @@
 )
 
 py_binary(
-  name = 'arm_mpc_py',
-  srcs = [
-    'arm_mpc.py',
-  ],
-  main = 'arm_mpc.py',
-  deps = [
-    '//external:python-gflags',
-    '//external:python-glog',
-    '//frc971/control_loops/python:controls',
-  ],
-  restricted_to = ['//tools:k8'],
+    name = "arm_mpc_py",
+    srcs = [
+        "arm_mpc.py",
+    ],
+    main = "arm_mpc.py",
+    restricted_to = ["//tools:k8"],
+    deps = [
+        "//external:python-gflags",
+        "//external:python-glog",
+        "//frc971/control_loops/python:controls",
+    ],
 )
diff --git a/y2018/control_loops/python/graph_edit.py b/y2018/control_loops/python/graph_edit.py
index dde67c5..e2b0412 100644
--- a/y2018/control_loops/python/graph_edit.py
+++ b/y2018/control_loops/python/graph_edit.py
@@ -1,3 +1,5 @@
+#!/usr/bin/python3
+
 from __future__ import print_function
 import os
 import basic_window
diff --git a/y2018/control_loops/superstructure/BUILD b/y2018/control_loops/superstructure/BUILD
index cc179d5..569e3a1 100644
--- a/y2018/control_loops/superstructure/BUILD
+++ b/y2018/control_loops/superstructure/BUILD
@@ -8,7 +8,7 @@
         "superstructure.q",
     ],
     deps = [
-        "//aos/common/controls:control_loop_queues",
+        "//aos/controls:control_loop_queues",
         "//frc971/control_loops:queues",
     ],
 )
@@ -23,7 +23,7 @@
     ],
     deps = [
         ":superstructure_queue",
-        "//aos/common/controls:control_loop",
+        "//aos/controls:control_loop",
         "//frc971/control_loops:queues",
         "//frc971/control_loops/drivetrain:drivetrain_queue",
         "//y2018:constants",
@@ -42,10 +42,10 @@
     deps = [
         ":superstructure_lib",
         ":superstructure_queue",
-        "//aos/common:math",
-        "//aos/common:queues",
-        "//aos/common:time",
-        "//aos/common/controls:control_loop_test",
+        "//aos:math",
+        "//aos:queues",
+        "//aos/time:time",
+        "//aos/controls:control_loop_test",
         "//aos/testing:googletest",
         "//frc971/control_loops:position_sensor_sim",
         "//frc971/control_loops:team_number_test_environment",
diff --git a/y2018/control_loops/superstructure/arm/BUILD b/y2018/control_loops/superstructure/arm/BUILD
index 1ec7ad7..bf30121 100644
--- a/y2018/control_loops/superstructure/arm/BUILD
+++ b/y2018/control_loops/superstructure/arm/BUILD
@@ -9,7 +9,7 @@
     visibility = ["//visibility:public"],
     deps = [
         ":dynamics",
-        "//aos/common/logging",
+        "//aos/logging",
         "//frc971/control_loops:dlqr",
         "//frc971/control_loops:jacobian",
         "//third_party/eigen",
@@ -129,7 +129,7 @@
         ":generated_graph",
         ":graph",
         ":trajectory",
-        "//aos/common/logging:queue_logging",
+        "//aos/logging:queue_logging",
         "//frc971/zeroing",
         "//y2018:constants",
         "//y2018/control_loops/superstructure:superstructure_queue",
diff --git a/y2018/control_loops/superstructure/arm/arm.cc b/y2018/control_loops/superstructure/arm/arm.cc
index a8c00cb..f3f58f8 100644
--- a/y2018/control_loops/superstructure/arm/arm.cc
+++ b/y2018/control_loops/superstructure/arm/arm.cc
@@ -3,8 +3,8 @@
 #include <chrono>
 #include <iostream>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
 #include "y2018/constants.h"
 #include "y2018/control_loops/superstructure/arm/demo_path.h"
 #include "y2018/control_loops/superstructure/arm/dynamics.h"
diff --git a/y2018/control_loops/superstructure/arm/trajectory.cc b/y2018/control_loops/superstructure/arm/trajectory.cc
index 48140dd..d251330 100644
--- a/y2018/control_loops/superstructure/arm/trajectory.cc
+++ b/y2018/control_loops/superstructure/arm/trajectory.cc
@@ -1,7 +1,7 @@
 #include "y2018/control_loops/superstructure/arm/trajectory.h"
 
 #include "Eigen/Dense"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/logging.h"
 #include "frc971/control_loops/dlqr.h"
 #include "frc971/control_loops/jacobian.h"
 #include "third_party/gflags/include/gflags/gflags.h"
diff --git a/y2018/control_loops/superstructure/intake/BUILD b/y2018/control_loops/superstructure/intake/BUILD
index ff2f16e..ca1289e 100644
--- a/y2018/control_loops/superstructure/intake/BUILD
+++ b/y2018/control_loops/superstructure/intake/BUILD
@@ -39,9 +39,9 @@
     visibility = ["//visibility:public"],
     deps = [
         ":intake_plants",
-        "//aos/common:math",
-        "//aos/common/controls:control_loop",
-        "//aos/common/logging:queue_logging",
+        "//aos:math",
+        "//aos/controls:control_loop",
+        "//aos/logging:queue_logging",
         "//frc971/control_loops:queues",
         "//frc971/zeroing",
         "//y2018:constants",
diff --git a/y2018/control_loops/superstructure/intake/intake.cc b/y2018/control_loops/superstructure/intake/intake.cc
index 080720a..6707356 100644
--- a/y2018/control_loops/superstructure/intake/intake.cc
+++ b/y2018/control_loops/superstructure/intake/intake.cc
@@ -2,10 +2,10 @@
 
 #include <chrono>
 
-#include "aos/common/commonmath.h"
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
+#include "aos/commonmath.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
 
 #include "y2018/constants.h"
 #include "y2018/control_loops/superstructure/intake/intake_delayed_plant.h"
diff --git a/y2018/control_loops/superstructure/intake/intake.h b/y2018/control_loops/superstructure/intake/intake.h
index e570c50..dff0adc 100644
--- a/y2018/control_loops/superstructure/intake/intake.h
+++ b/y2018/control_loops/superstructure/intake/intake.h
@@ -1,8 +1,8 @@
 #ifndef Y2018_CONTROL_LOOPS_SUPERSTRUCTURE_INTAKE_INTAKE_H_
 #define Y2018_CONTROL_LOOPS_SUPERSTRUCTURE_INTAKE_INTAKE_H_
 
-#include "aos/common/commonmath.h"
-#include "aos/common/controls/control_loop.h"
+#include "aos/commonmath.h"
+#include "aos/controls/control_loop.h"
 #include "frc971/control_loops/control_loops.q.h"
 #include "frc971/zeroing/zeroing.h"
 #include "y2018/constants.h"
diff --git a/y2018/control_loops/superstructure/superstructure.cc b/y2018/control_loops/superstructure/superstructure.cc
index 26f75be..c2d0bcf 100644
--- a/y2018/control_loops/superstructure/superstructure.cc
+++ b/y2018/control_loops/superstructure/superstructure.cc
@@ -2,8 +2,8 @@
 
 #include <chrono>
 
-#include "aos/common/controls/control_loops.q.h"
-#include "aos/common/logging/logging.h"
+#include "aos/controls/control_loops.q.h"
+#include "aos/logging/logging.h"
 #include "frc971/control_loops/control_loops.q.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "y2018/constants.h"
diff --git a/y2018/control_loops/superstructure/superstructure.h b/y2018/control_loops/superstructure/superstructure.h
index ec0c9e1..4f8f4d5 100644
--- a/y2018/control_loops/superstructure/superstructure.h
+++ b/y2018/control_loops/superstructure/superstructure.h
@@ -3,7 +3,7 @@
 
 #include <memory>
 
-#include "aos/common/controls/control_loop.h"
+#include "aos/controls/control_loop.h"
 #include "frc971/control_loops/state_feedback_loop.h"
 #include "y2018/control_loops/superstructure/arm/arm.h"
 #include "y2018/control_loops/superstructure/intake/intake.h"
diff --git a/y2018/control_loops/superstructure/superstructure.q b/y2018/control_loops/superstructure/superstructure.q
index fc1d935..ee38539 100644
--- a/y2018/control_loops/superstructure/superstructure.q
+++ b/y2018/control_loops/superstructure/superstructure.q
@@ -1,6 +1,6 @@
 package y2018.control_loops;
 
-import "aos/common/controls/control_loops.q";
+import "aos/controls/control_loops.q";
 import "frc971/control_loops/control_loops.q";
 
 struct IntakeSideStatus {
diff --git a/y2018/control_loops/superstructure/superstructure_lib_test.cc b/y2018/control_loops/superstructure/superstructure_lib_test.cc
index d21d1ce..62b20f8 100644
--- a/y2018/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2018/control_loops/superstructure/superstructure_lib_test.cc
@@ -5,8 +5,8 @@
 #include <chrono>
 #include <memory>
 
-#include "aos/common/controls/control_loop_test.h"
-#include "aos/common/queue.h"
+#include "aos/controls/control_loop_test.h"
+#include "aos/queue.h"
 #include "frc971/control_loops/drivetrain/drivetrain.q.h"
 #include "frc971/control_loops/position_sensor_sim.h"
 #include "frc971/control_loops/team_number_test_environment.h"
diff --git a/y2018/joystick_reader.cc b/y2018/joystick_reader.cc
index 45b7302..de8f1f6 100644
--- a/y2018/joystick_reader.cc
+++ b/y2018/joystick_reader.cc
@@ -5,13 +5,13 @@
 #include <mutex>
 #include <google/protobuf/stubs/stringprintf.h>
 
-#include "aos/common/actions/actions.h"
-#include "aos/common/input/driver_station_data.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/network/team_number.h"
-#include "aos/common/stl_mutex.h"
-#include "aos/common/time.h"
-#include "aos/common/util/log_interval.h"
+#include "aos/actions/actions.h"
+#include "aos/input/driver_station_data.h"
+#include "aos/logging/logging.h"
+#include "aos/network/team_number.h"
+#include "aos/stl_mutex/stl_mutex.h"
+#include "aos/time/time.h"
+#include "aos/util/log_interval.h"
 #include "aos/input/drivetrain_input.h"
 #include "aos/input/joystick_input.h"
 #include "aos/linux_code/init.h"
diff --git a/y2018/vision/BUILD b/y2018/vision/BUILD
index dfe5ebb..4093ebc 100644
--- a/y2018/vision/BUILD
+++ b/y2018/vision/BUILD
@@ -4,8 +4,8 @@
     name = "image_streamer",
     srcs = ["image_streamer.cc"],
     deps = [
-        "//aos/common/logging",
-        "//aos/common/logging:implementations",
+        "//aos/logging",
+        "//aos/logging:implementations",
         "//aos/vision/blob:codec",
         "//aos/vision/events:epoll_events",
         "//aos/vision/events:socket_types",
@@ -33,9 +33,9 @@
     visibility = ["//visibility:public"],
     deps = [
         ":vision_queue",
-        "//aos/common:time",
-        "//aos/common/logging",
-        "//aos/common/logging:queue_logging",
+        "//aos/time:time",
+        "//aos/logging",
+        "//aos/logging:queue_logging",
         "//aos/linux_code:init",
         "//aos/vision/events:udp",
         "//y2018:vision_proto",
diff --git a/y2018/vision/image_streamer.cc b/y2018/vision/image_streamer.cc
index f6da93c..dea6a77 100644
--- a/y2018/vision/image_streamer.cc
+++ b/y2018/vision/image_streamer.cc
@@ -5,8 +5,8 @@
 #include <fstream>
 #include <string>
 
-#include "aos/common/logging/implementations.h"
-#include "aos/common/logging/logging.h"
+#include "aos/logging/implementations.h"
+#include "aos/logging/logging.h"
 #include "aos/vision/blob/codec.h"
 #include "aos/vision/events/socket_types.h"
 #include "aos/vision/events/udp.h"
diff --git a/y2018/vision/vision_status.cc b/y2018/vision/vision_status.cc
index e8ac6db..6234659 100644
--- a/y2018/vision/vision_status.cc
+++ b/y2018/vision/vision_status.cc
@@ -1,8 +1,8 @@
 #include <netdb.h>
 
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/time.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/time/time.h"
 #include "aos/linux_code/init.h"
 #include "aos/vision/events/udp.h"
 #include "y2018/vision.pb.h"
diff --git a/y2018/wpilib_interface.cc b/y2018/wpilib_interface.cc
index ec54da8..4cb6de0 100644
--- a/y2018/wpilib_interface.cc
+++ b/y2018/wpilib_interface.cc
@@ -21,16 +21,16 @@
 #include "ctre/phoenix/CANifier.h"
 #undef ERROR
 
-#include "aos/common/commonmath.h"
-#include "aos/common/logging/logging.h"
-#include "aos/common/logging/queue_logging.h"
-#include "aos/common/messages/robot_state.q.h"
-#include "aos/common/stl_mutex.h"
-#include "aos/common/time.h"
-#include "aos/common/util/compiler_memory_barrier.h"
-#include "aos/common/util/log_interval.h"
-#include "aos/common/util/phased_loop.h"
-#include "aos/common/util/wrapping_counter.h"
+#include "aos/commonmath.h"
+#include "aos/logging/logging.h"
+#include "aos/logging/queue_logging.h"
+#include "aos/robot_state/robot_state.q.h"
+#include "aos/stl_mutex/stl_mutex.h"
+#include "aos/time/time.h"
+#include "aos/util/compiler_memory_barrier.h"
+#include "aos/util/log_interval.h"
+#include "aos/util/phased_loop.h"
+#include "aos/util/wrapping_counter.h"
 #include "aos/linux_code/init.h"
 
 #include "frc971/autonomous/auto.q.h"