Port basic Atom support to current upstream master.