Cleaned up the reference of globals, added some basic commands.