Previous commit was erroneous. Now it's complete. Methods still not implemented, but it looks ok at least.