Cleaner code
Proper extension handling

I don't know if this is completely correctly but should do for now.
Redirect some error prints to stderr
Bump version