Refactor CPU detection code to be more reliable

Instead of parsing hwinfo output, which might or might be present
on systems, just parse the /proc/cpuinfo file, it's much more
reliable.