Fixed primesTo and commented/cleaned up some code.
Made primesTo use io_lib:format("~w") rather than ~p which means they are all on one line and can be sent to IRC nicely.