Write tests for the from_signature module

... and split the main function!