Implement a user authentication system in the /app/ directory that includes the following functionality:
User Registration:
Create a function register_user(username: str, password: str) -> bool that registers a new user.
Usernames must be unique (i.e., no duplicates allowed).
Passwords must be at least 8 characters long.
On successful registration, return True; otherwise, return False.
User Login:
Create a function login_user(username: str, password: str) -> bool that allows a registered user to log in.
The function should verify the username and password against the stored credentials.
On successful login, return True; otherwise, return False.
User Logout:
Create a function logout_user(username: str) -> bool that logs out the specified user.
On successful logout, return True; otherwise, return False.
Data Storage:
Use an in-memory data structure (e.g., a dictionary) to store user information with usernames as keys and passwords as values.
Ensure that user passwords are stored securely (e.g., hashed) and cannot be retrieved in plain text.
Your code must be structured in a way that follows best practices and incorporates error handling for invalid inputs (e.g., short passwords, empty usernames, login attempts with non-existent users). Ensure that the implemented functions are tested with clear and informative unit tests to validate their functionality.