Basic S3 and Sqs functions implemented in PHP and JS