Added shell functionality and a few basic commands. Misc bug fixes.