turning javascript into module and allowing for options