Refactored all the Squirrel logic out of Client

Needs to be shared so we can use it in Server