Clean up architecture detection

As with the #13, this uses ``case`` statements to greatly simplify the detection and handling of the architecture.