Code optimize

$require will not load loaded resource;
Better code for trim and mapcall;
Optimize shortcut to reduce file size;