Revert "Moved form JS outside doc ready"

This reverts commit 3266a0a11cc6bc469c1af0435699afb84c3b165d.