Cloned from factbook-core, package utils excluded to eliminate recursive dependency wirh factbook-indexing. Fixed and tested all profile functionality.