moar cleanup

This time on the php side.
Improved sideButton functions

All known bugs fixed. Please let me know if there are more.