Move fdt handling logic out of main.c.

This is in preparation for having archs/platforms that don't use FDT.
diff --git a/inc/memiter.h b/inc/memiter.h
new file mode 100644
index 0000000..ffaa822
--- /dev/null
+++ b/inc/memiter.h
@@ -0,0 +1,18 @@
+#ifndef _MEMITER_H
+#define _MEMITER_H
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+struct memiter {
+	const char *next;
+	const char *limit;
+};
+
+void memiter_init(struct memiter *it, const void *data, size_t size);
+bool memiter_parse_uint(struct memiter *it, uint64_t *value);
+bool memiter_parse_str(struct memiter *it, struct memiter *str);
+bool memiter_iseq(const struct memiter *it, const char *str);
+
+#endif /* _MEMITER_H */