Huge changes to the floating button system

I refactored and changed about half of this file.