Changed the way the Id is generated

The Id is now generated with a workaround to get around the 'no static
member function' problem. Also changed the way the id Is converted to a
string.