resourceloader: Use $.ajax instead of duplicating its "script" logic

Also removed isFunction check. This is an internal method and the
parameter is either a function or omitted/nulled. No need for aggressive
validation.

Change-Id: I6bbd82ca1b986b45a2f4653427396b9a6fceb6e8
Merge "resourceloader: Use $.ajax instead of duplicating its "script" logic"