Move core implementations to core.cpp
Merge pull request #2792 from sipa/coreimpl

Move core implementations to core.cpp