IE is unhappy if insertBefore has a refNode argument that is undefined so ensure it’s at least null. Partially addresses issue #333
IE does not trim an option.value if it is created with surrounding spaces. Partially fixes issue #333.