Base: Move OS specific changes earlier in execution

Also ensure JSHint passes