Fix Firefox subsection datetime bug

https://edx-wiki.atlassian.net/browse/STUD-583

Firefox wasn't saving section release times, due to issues with JS Date() parsing. I've modified the code to make it more explicit around what it should do and how it should work, which also makes it work better with both Firefox and Chrome. Also did a bit of unrelated code cleanup/re-formatting.