pySim-read.py: Added a common card detection function for both pySim-prog.py and pySim-read.py

This function is used to detect the card type and return Card class/Card subclasses object
if its a know card or else None. Also, an initial step towards refactoring of code.

Change-Id: I71f57c6403dc933bd9d54f90df3d3fe105b4f66f
diff --git a/pysim-testdata/fakemagicsim.ok b/pysim-testdata/fakemagicsim.ok
index 816b3dc..4ee5c7f 100644
--- a/pysim-testdata/fakemagicsim.ok
+++ b/pysim-testdata/fakemagicsim.ok
@@ -1,5 +1,6 @@
 Using PC/SC reader (dev=2) interface
 Reading ...
+Autodetected card type: fakemagicsim
 ICCID: 1122334455667788990
 IMSI: 001010000000102
 GID1: Can't read file -- SW match failed! Expected 9000 and got 9404.