Rename variables
Added support for spaces in category titles; Misc. refactoring