Source reorganization

- Moved the for_each functions adaptors to a separate header.