Fix #983 Assets::js() base_url issues

used change listed in the discussion for the issue.

Additionally, added a path() method similar to suggestion by @hArpanet
(also in the discussion for the issue), and modified most of the
path-building in the library to use the method.

Finally, some cleanup throughout the library and a fix for some odd
issues with script names getting mangled when removing the file
extension.