Added tag handling functions to core, use in part of startup (not all done)
Progress on refdb integration