Refactor derive_sdk to be more testable

Refactor the code into a reusable library that is used from the
derive_sdk binary as well as a newly added cc_test.

The code now accepts an argument for which dir to scan for mounted
modules.

Add a simple test for the current system image R SDK version for now.

Bug: 173188089
Test: atest derive_sdk_test
Change-Id: If7442d515d55b35174d396cc579ee2c9865da2b5
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 3dc1b9f..9ae7703 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -4,6 +4,9 @@
       "name": "CtsSdkExtensionsTestCases"
     },
     {
+      "name": "derive_sdk_test"
+    },
+    {
       "name": "sdkextensions_e2e_tests"
     }
   ]