Refactored signing to seperate parameter extraction, moved to a different file, fixed up tests