Added Foreach, and refactored Component to belong to core