Improved logging and removed unnecessary parameters from some functions. Added simple demo to test page.