Got logbase_test to fully functional and correct state.

- Elaborated on error and debug functionality
- Corrected file opening and closing, and file locking