parser: removed unused vars, rewrote assignment code

Parser code is now not read only. Also, support for more than 2 dimensions underway.