switch to new sdk and build tools, fix compatibility errors
merged latest 'master' changes