Implement recursive buildup of data structures

Duplicate key checking and [[section]] support still missing