fix(typeloader) load custom resources from package.json if exists

Fix #172 and #320 (these were not fixed, since the PR was rollbacked).
Check if there is a package.json, get all the dependencies found and load them from node_modules.
If there's no package.json, keep the former behaviour (load everything from ./node_modules).