re-organized code, seperated into files / modules

Also fixed css for input box by removing extra padding / margin.
Changed some variables to react differently to the system namespace.