Moved random data functions to another file and added tests