Master cleanup

Update deprecated and outdated code to current 2.x master.