Fixed javascript so that error handling works. Could use more work in the splitLineArray function, as the 'throw' has useful info instead of return. LOL