Javascript structure map/filter walker