In case of the zeroes and ones, you have to split with "", but in case of the tile-numbers this doesn't work as it would create an array entry for - and 1 when the value should be -1. But luckily you have a delimiter , which you can use.
So instead of
levelTiles = levelTiles.split("\n").join("");
levelTiles = levelTiles.split(",").join("");
tileArray = levelTiles.split("");
Use:
levelTiles = levelTiles.split("\n").join(""",");
tileArray = levelTiles.split(",");
A cleaner way to split (which also removes unnecessary white-space) could be done with a regular expression:
tileArray = levelTiles.replace(/\n\r?/g,",").split(/\s*,\s*/);
To split the Bitstring and get rid of the white-space I suggest you use this instead:
bitArray = bitString.replace(/\s+/g, "").split("");