updating forlder structure to remove the public folder. Also fixed a few bug and added a functions file to the core folder