javascript modularisation, slight css tidying