Re-arrange core source and get rid of some unused files