Move Twitter XML parsing/error checking into a separate function and use it everywhere. This should be a more thorough fix for #953.