Stole the TypeGuesser (and its tests) from symfony's propel bridge