General cleanup; upgraded prime test to use Long instead of Int