Add a set of classes to manage queue indices

This handles wrapping and invalidating indices, and wraps up the atomics
for storing and reading indices atomically

Change-Id: I8190efb1f36a9840cb545c8b4e8f0ec04488e88e
diff --git a/aos/ipc_lib/BUILD b/aos/ipc_lib/BUILD
index 85f6dcd..6947df1 100644
--- a/aos/ipc_lib/BUILD
+++ b/aos/ipc_lib/BUILD
@@ -161,3 +161,18 @@
         "//aos/logging",
     ],
 )
+
+cc_library(
+    name = "index",
+    hdrs = ["index.h"],
+)
+
+cc_test(
+    name = "index_test",
+    srcs = ["index_test.cc"],
+    deps = [
+        ":index",
+        "//aos/testing:googletest",
+        "//aos/testing:test_logging",
+    ],
+)