Clean up tests to use synchronous initialisation where setTimeout's were previously being used to get around it.