[lib] push the foundation specific bits under `Foundation`
[lib] add some dispatch support