Taxpayers are turning to an app to defend themselves against residency audits as states look at everything from how much time one spends in a state to what some call the “teddy bear test," essentially where the taxpayer’s valuable artwork, family heirlooms and, increasingly, pets are located.