Use coffeescript official suggestion to create top-level variables for other scripts to use

Signed-off-by: Lincoln Lee <git@lincoln.hk>
Replace undefined with null

Signed-off-by: Lincoln Lee <git@lincoln.hk>