Refactoring withinWorld method
Clean up documentation
Move entry point into js file