Documentation and code-style overhaul