Initial fixes to make it work with a simple (test.png) image

Hey Justin,
this lib is really interesting and could prove really handy!

I've made some changes and looks like I've managed to make it work with a _much simpler_ image in flash (DemoFromBitmap). I couldn't track down a nasty bug which causes a null ref access, but it's a start.

The codebase is still a bit messy for my tastes and I feel that maybe the original author could be interested in improving it (have you contacted him yet?). 

I'm actually trying to make a one-to-one _manual_ port so that I'll grow confidence with the original AS3 code. I'll keep you posted if you're interested.