update old code
update old refs
test files for #389
Support --resource for #389
Generate resources file for #389
tests for #389
share main method for run tests
Add runtime tests for #389
resources support at runtime #389