factored out declaration parser
added access to remote access of local variables of global scripts