Client performance and style improvements (alignment, double buffer, caching fix, background threads fix)