Better error handling quick fix

- mg.onerror returning non-zero wasn't stopping processing as it was supposed to, fixed.
- Removed a line of dead code
- Documented Lua pages `mg` table