Changes for https://jira.appcelerator.org/browse/NODEJS-1750

Note: some test case was failed because of a sdk code issue, a ticket is filed https://jira.appcelerator.org/browse/NODEJS-1784