Organize core/mem in a sane way
Fix missing #pragma once
Update all files dependent on previous core/mem organization