Moved general functionality to shared

Moved some general functions that could be useful for everyone to the
basic.php in the shared folder