Core: Add GUID method

Replace separate random ID generators with a single implementation.
Having a single stub-able method will make it easier for testing.