better error message and improve code to be more coffe script
Added test case
fix problem when change basepath
improve code
rewritten the whole thing
TODO: now write it with async (test could not test multiple loads)