Significantly expanded documentation + cleaned up old code