Use array maps to preserve dependency order.

This patch should be rather straightforward: Instead of using hash maps, which doesn't preserve dependency ordering, array maps are used. `array-map-assoc` is implemented is because `merge` and `assoc` may convert array maps into hash maps.

This seems to fix #268.