Changed structure into core + top level wrapper to allow for config interface etc.