moved stuff into core and fixed some namespaces