First pass at JS. Very incomplete
main