Update locallib.php

Made ammendments to your latest locallib.php file

They include 
- All tabs removed
- Removal of unused code
- html_writer::tag() now used
- Button functionality changed to toggle
- Section of code to retrieve row id changed