Broke core functionality out into its file as per flask extensions guidelines. It seems to work quite well, still need JS templates