Now returning "api" along with the jQuery object

The api object is now returned along it the jQuery object, so it can be accessed by other means than just from the callback function;
Re-factored some code to pass JS Lint (www.jslint.com)
Added comment with author, license, etc.

Signed-off-by: Miguel Guerreiro <miguel.guerreiro@gmail.com>