CDK-127: Fixing format handling and NPE.

Format handling: check to see the format can be read inside open(). If not,
then throw an UnknownFormatException.

NPE: If there is no reader, then hasNext() would return false. In the Iterator
interface, this should result in a NoSuchElementException. This is the only
case to check because the next implementation delegates to the inner reader,
which is responsible for NoSuchElementExceptions in other cases where hasNext()
returned false.