Add require to README usage example
Add basic test script
Minor refactoring