color index computing fixes, including
https://code.google.com/p/skia/source/detail?r=12786
throwing exceptions for errors during initializing moved to native code
input stream closing moved to native code
screen size checking changed to handle overflows
minor performance improvements in native code