fix issues on windows platforms, use directory_separator instead of slash
fix tests for windows
implement toArray helper, converting nested objects to associative array