Mac implementation of reference test window. Moved some parts of the reference test implementation to platform-independent code, and moved reference window into its own process for Mac.