Moved test code to a separate file.