Cookies

@s-panferov I think this handles everything.

cc @reem 
This should use `Vec::with_capacity` to avoid resizing.