Cleaned up functions/comments in common.php

Fixes #28