Document events, resolve obscure methods, format, optimize imports