Fix `prepare`

The parsing algorithm was broken and prepare couldn't recognize RPC
nodes. The mistake probably happened when I added Action support, but
with no tests. Tests are now included.

Change-Id: I1b4eb2eb76a30c4495e2aacbb6848f449eba3abb
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ecbe0b..a1f027c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -287,6 +287,7 @@
     cli_test(path_utils)
     target_link_libraries(test_path_utils path)
     cli_test(keyvalue_completion)
+    cli_test(prepare)
 
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/init_datastore.bash.in
         ${CMAKE_CURRENT_BINARY_DIR}/init_datastore.bash @ONLY)