Atoms

replaces #7272 (it is rebased over master and is_number was simplified in the last commit) and resolves #5526