Does this even work on Windows? Too bad JS doesn't have an actual basename function that we could use.