JS cleanup and bug fix for submitting new position via Enter key