namespace support

Added namespace support; various bug fixes