Restructured to use Optionals correctly (again) and implemented filename restrictions by operating system